NetCDF  4.6.1
 All Data Structures Files Functions Variables Typedefs Macros Modules Pages
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 
38 static void
39 odom_init(struct GETodometer* odom, int rank, const size_t* start,
40  const size_t* edges, const ptrdiff_t* stride)
41 {
42  int i;
43  memset(odom,0,sizeof(struct GETodometer));
44  odom->rank = rank;
45  assert(odom->rank <= NC_MAX_VAR_DIMS);
46  for(i=0;i<odom->rank;i++) {
47  odom->start[i] = (start != NULL ? start[i] : 0);
48  odom->edges[i] = (edges != NULL ? edges[i] : 1);
49  odom->stride[i] = (stride != NULL ? stride[i] : 1);
50  odom->stop[i] = odom->start[i] + (odom->edges[i]*((size_t)odom->stride[i]));
51  odom->index[i] = odom->start[i];
52  }
53 }
54 
62 static int
63 odom_more(struct GETodometer* odom)
64 {
65  return (odom->index[0] < odom->stop[0]);
66 }
67 
75 static int
76 odom_next(struct GETodometer* odom)
77 {
78  int i;
79  if(odom->rank == 0) return 0;
80  for(i=odom->rank-1;i>=0;i--) {
81  odom->index[i] += (size_t)odom->stride[i];
82  if(odom->index[i] < odom->stop[i]) break;
83  if(i == 0) return 0; /* leave the 0th entry if it overflows*/
84  odom->index[i] = odom->start[i]; /* reset this position*/
85  }
86  return 1;
87 }
88 #endif
89 
94 int
95 NC_get_vara(int ncid, int varid,
96  const size_t *start, const size_t *edges,
97  void *value, nc_type memtype)
98 {
99  NC* ncp;
100  int stat = NC_check_id(ncid, &ncp);
101  if(stat != NC_NOERR) return stat;
102 #ifdef USE_NETCDF4
103  if(memtype >= NC_FIRSTUSERTYPEID) memtype = NC_NAT;
104 #endif
105 
106  if(edges == NULL) {
107  size_t shape[NC_MAX_VAR_DIMS];
108  int ndims;
109  stat = nc_inq_varndims(ncid, varid, &ndims);
110  if(stat != NC_NOERR) return stat;
111  stat = NC_getshape(ncid,varid,ndims,shape);
112  if(stat != NC_NOERR) return stat;
113  stat = ncp->dispatch->get_vara(ncid,varid,start,shape,value,memtype);
114  } else
115  stat = ncp->dispatch->get_vara(ncid,varid,start,edges,value,memtype);
116  return stat;
117 }
118 
145 static int
146 NC_get_var(int ncid, int varid, void *value, nc_type memtype)
147 {
148  int ndims;
149  size_t shape[NC_MAX_VAR_DIMS];
150  int stat = nc_inq_varndims(ncid,varid, &ndims);
151  if(stat) return stat;
152  stat = NC_getshape(ncid,varid, ndims, shape);
153  if(stat) return stat;
154  return NC_get_vara(ncid, varid, NC_coord_zero, shape, value, memtype);
155 }
156 
161 int
162 NCDEFAULT_get_vars(int ncid, int varid, const size_t * start,
163  const size_t * edges, const ptrdiff_t * stride,
164  void *value0, nc_type memtype)
165 {
166 #ifdef VARS_USES_VARM
167  NC* ncp;
168  int stat = NC_check_id(ncid, &ncp);
169 
170  if(stat != NC_NOERR) return stat;
171  return ncp->dispatch->get_varm(ncid,varid,start,edges,stride,NULL,value0,memtype);
172 #else
173  /* Rebuilt get_vars code to simplify and avoid use of get_varm */
174 
175  int status = NC_NOERR;
176  int i,simplestride,isrecvar;
177  int rank;
178  struct GETodometer odom;
179  nc_type vartype = NC_NAT;
180  NC* ncp;
181  int memtypelen;
182  size_t vartypelen;
183  size_t nels;
184  char* value = (char*)value0;
185  size_t numrecs;
186  size_t varshape[NC_MAX_VAR_DIMS];
187  size_t mystart[NC_MAX_VAR_DIMS];
188  size_t myedges[NC_MAX_VAR_DIMS];
189  ptrdiff_t mystride[NC_MAX_VAR_DIMS];
190  char *memptr = NULL;
191 
192  status = NC_check_id (ncid, &ncp);
193  if(status != NC_NOERR) return status;
194 
195  status = nc_inq_vartype(ncid, varid, &vartype);
196  if(status != NC_NOERR) return status;
197 
198  if(memtype == NC_NAT) memtype = vartype;
199 
200  /* compute the variable type size */
201  status = nc_inq_type(ncid,vartype,NULL,&vartypelen);
202  if(status != NC_NOERR) return status;
203 
204  if(memtype > NC_MAX_ATOMIC_TYPE)
205  memtypelen = (int)vartypelen;
206  else
207  memtypelen = nctypelen(memtype);
208 
209  /* Check gross internal/external type compatibility */
210  if(vartype != memtype) {
211  /* If !atomic, the two types must be the same */
212  if(vartype > NC_MAX_ATOMIC_TYPE
213  || memtype > NC_MAX_ATOMIC_TYPE)
214  return NC_EBADTYPE;
215  /* ok, the types differ but both are atomic */
216  if(memtype == NC_CHAR || vartype == NC_CHAR)
217  return NC_ECHAR;
218  }
219 
220  /* Get the variable rank */
221  status = nc_inq_varndims(ncid, varid, &rank);
222  if(status != NC_NOERR) return status;
223 
224  /* Get variable dimension sizes */
225  isrecvar = NC_is_recvar(ncid,varid,&numrecs);
226  NC_getshape(ncid,varid,rank,varshape);
227 
228  /* Optimize out using various checks */
229  if (rank == 0) {
230  /*
231  * The variable is a scalar; consequently,
232  * there s only one thing to get and only one place to put it.
233  * (Why was I called?)
234  */
235  size_t edge1[1] = {1};
236  return NC_get_vara(ncid, varid, start, edge1, value, memtype);
237  }
238 
239  /* Do various checks and fixups on start/edges/stride */
240  simplestride = 1; /* assume so */
241  nels = 1;
242  for(i=0;i<rank;i++) {
243  size_t dimlen;
244  mystart[i] = (start == NULL ? 0 : start[i]);
245  /* illegal value checks */
246  dimlen = (i == 0 && isrecvar ? numrecs : varshape[i]);
247  /* mystart is unsigned, never < 0 */
248 #ifdef RELAX_COORD_BOUND
249  if (mystart[i] > dimlen) return NC_EINVALCOORDS;
250 #else
251  if (mystart[i] >= dimlen) return NC_EINVALCOORDS;
252 #endif
253  if(edges == NULL) {
254  if(i == 0 && isrecvar)
255  myedges[i] = numrecs - start[i];
256  else
257  myedges[i] = varshape[i] - mystart[i];
258  } else
259  myedges[i] = edges[i];
260 #ifdef RELAX_COORD_BOUND
261  if (mystart[i] == dimlen && myedges[i] > 0) return NC_EINVALCOORDS;
262 #endif
263  /* myedges is unsigned, never < 0 */
264  if(mystart[i] + myedges[i] > dimlen)
265  return NC_EEDGE;
266  mystride[i] = (stride == NULL ? 1 : stride[i]);
267  if(mystride[i] <= 0
268  /* cast needed for braindead systems with signed size_t */
269  || ((unsigned long) mystride[i] >= X_INT_MAX))
270  return NC_ESTRIDE;
271  if(mystride[i] != 1) simplestride = 0;
272  if(myedges[i] == 0)
273  nels = 0;
274  }
275  if(nels == 0)
276  return NC_NOERR; /* cannot read anything */
277  if(simplestride) {
278  return NC_get_vara(ncid, varid, mystart, myedges, value, memtype);
279  }
280 
281  /* memptr indicates where to store the next value */
282  memptr = value;
283 
284  odom_init(&odom,rank,mystart,myedges,mystride);
285 
286  /* walk the odometer to extract values */
287  while(odom_more(&odom)) {
288  int localstatus = NC_NOERR;
289  /* Read a single value */
290  localstatus = NC_get_vara(ncid,varid,odom.index,nc_sizevector1,memptr,memtype);
291  /* So it turns out that when get_varm is used, all errors are
292  delayed and ERANGE will be overwritten by more serious errors.
293  */
294  if(localstatus != NC_NOERR) {
295  if(status == NC_NOERR || localstatus != NC_ERANGE)
296  status = localstatus;
297  }
298  memptr += memtypelen;
299  odom_next(&odom);
300  }
301  return status;
302 #endif
303 }
304 
308 static int
309 NC_get_var1(int ncid, int varid, const size_t *coord, void* value,
310  nc_type memtype)
311 {
312  return NC_get_vara(ncid, varid, coord, NC_coord_one, value, memtype);
313 }
314 
318 int
319 NCDEFAULT_get_varm(int ncid, int varid, const size_t *start,
320  const size_t *edges, const ptrdiff_t *stride,
321  const ptrdiff_t *imapp, void *value0, nc_type memtype)
322 {
323  int status = NC_NOERR;
324  nc_type vartype = NC_NAT;
325  int varndims,maxidim;
326  NC* ncp;
327  int memtypelen;
328  char* value = (char*)value0;
329 
330  status = NC_check_id (ncid, &ncp);
331  if(status != NC_NOERR) return status;
332 
333 /*
334  if(NC_indef(ncp)) return NC_EINDEFINE;
335 */
336 
337  status = nc_inq_vartype(ncid, varid, &vartype);
338  if(status != NC_NOERR) return status;
339  /* Check that this is an atomic type */
340  if(vartype > NC_MAX_ATOMIC_TYPE)
341  return NC_EMAPTYPE;
342 
343  status = nc_inq_varndims(ncid, varid, &varndims);
344  if(status != NC_NOERR) return status;
345 
346  if(memtype == NC_NAT) {
347  memtype = vartype;
348  }
349 
350  if(memtype == NC_CHAR && vartype != NC_CHAR)
351  return NC_ECHAR;
352  else if(memtype != NC_CHAR && vartype == NC_CHAR)
353  return NC_ECHAR;
354 
355  memtypelen = nctypelen(memtype);
356 
357  maxidim = (int) varndims - 1;
358 
359  if (maxidim < 0)
360  {
361  /*
362  * The variable is a scalar; consequently,
363  * there s only one thing to get and only one place to put it.
364  * (Why was I called?)
365  */
366  size_t edge1[1] = {1};
367  return NC_get_vara(ncid, varid, start, edge1, value, memtype);
368  }
369 
370  /*
371  * else
372  * The variable is an array.
373  */
374  {
375  int idim;
376  size_t *mystart = NULL;
377  size_t *myedges;
378  size_t *iocount; /* count vector */
379  size_t *stop; /* stop indexes */
380  size_t *length; /* edge lengths in bytes */
381  ptrdiff_t *mystride;
382  ptrdiff_t *mymap;
383  size_t varshape[NC_MAX_VAR_DIMS];
384  int isrecvar;
385  size_t numrecs;
386 
387  /* Compute some dimension related values */
388  isrecvar = NC_is_recvar(ncid,varid,&numrecs);
389  NC_getshape(ncid,varid,varndims,varshape);
390 
391  /*
392  * Verify stride argument; also see if stride is all ones
393  */
394  if(stride != NULL) {
395  int stride1 = 1;
396  for (idim = 0; idim <= maxidim; ++idim)
397  {
398  if (stride[idim] == 0
399  /* cast needed for braindead systems with signed size_t */
400  || ((unsigned long) stride[idim] >= X_INT_MAX))
401  {
402  return NC_ESTRIDE;
403  }
404  if(stride[idim] != 1) stride1 = 0;
405  }
406  /* If stride1 is true, and there is no imap
407  then call get_vara directly.
408  */
409  if(stride1 && imapp == NULL) {
410  return NC_get_vara(ncid, varid, start, edges, value, memtype);
411  }
412  }
413 
414  /* assert(sizeof(ptrdiff_t) >= sizeof(size_t)); */
415  /* Allocate space for mystart,mystride,mymap etc.all at once */
416  mystart = (size_t *)calloc((size_t)(varndims * 7), sizeof(ptrdiff_t));
417  if(mystart == NULL) return NC_ENOMEM;
418  myedges = mystart + varndims;
419  iocount = myedges + varndims;
420  stop = iocount + varndims;
421  length = stop + varndims;
422  mystride = (ptrdiff_t *)(length + varndims);
423  mymap = mystride + varndims;
424 
425  /*
426  * Check start, edges
427  */
428  for (idim = maxidim; idim >= 0; --idim)
429  {
430  size_t dimlen =
431  idim == 0 && isrecvar
432  ? numrecs
433  : varshape[idim];
434 
435  mystart[idim] = start != NULL
436  ? start[idim]
437  : 0;
438 
439 #ifdef RELAX_COORD_BOUND
440  if (mystart[idim] > dimlen)
441 #else
442  if (mystart[idim] >= dimlen)
443 #endif
444  {
445  status = NC_EINVALCOORDS;
446  goto done;
447  }
448 
449 #ifdef COMPLEX
450  myedges[idim] = edges != NULL
451  ? edges[idim]
452  : idim == 0 && isrecvar
453  ? numrecs - mystart[idim]
454  : varshape[idim] - mystart[idim];
455 #else
456  if(edges != NULL)
457  myedges[idim] = edges[idim];
458  else if (idim == 0 && isrecvar)
459  myedges[idim] = numrecs - mystart[idim];
460  else
461  myedges[idim] = varshape[idim] - mystart[idim];
462 #endif
463 
464 #ifdef RELAX_COORD_BOUND
465  if (mystart[idim] == dimlen && myedges[idim] > 0)
466  {
467  status = NC_EINVALCOORDS;
468  goto done;
469  }
470 #endif
471 
472  if (mystart[idim] + myedges[idim] > dimlen)
473  {
474  status = NC_EEDGE;
475  goto done;
476  }
477  }
478 
479 
480  /*
481  * Initialize I/O parameters.
482  */
483  for (idim = maxidim; idim >= 0; --idim)
484  {
485  if (edges != NULL && edges[idim] == 0)
486  {
487  status = NC_NOERR; /* read/write no data */
488  goto done;
489  }
490 
491  mystride[idim] = stride != NULL
492  ? stride[idim]
493  : 1;
494 
495  /* Remember: in netCDF-2 imapp is byte oriented, not index oriented
496  * Starting from netCDF-3, imapp is index oriented */
497 #ifdef COMPLEX
498  mymap[idim] = (imapp != NULL
499  ? imapp[idim]
500  : (idim == maxidim ? 1
501  : mymap[idim + 1] * (ptrdiff_t) myedges[idim + 1]));
502 #else
503  if(imapp != NULL)
504  mymap[idim] = imapp[idim];
505  else if (idim == maxidim)
506  mymap[idim] = 1;
507  else
508  mymap[idim] =
509  mymap[idim + 1] * (ptrdiff_t) myedges[idim + 1];
510 #endif
511  iocount[idim] = 1;
512  length[idim] = ((size_t)mymap[idim]) * myedges[idim];
513  stop[idim] = (mystart[idim] + myedges[idim] * (size_t)mystride[idim]);
514  }
515 
516  /* Lower body */
517  /*
518  * As an optimization, adjust I/O parameters when the fastest
519  * dimension has unity stride both externally and internally.
520  * In this case, the user could have called a simpler routine
521  * (i.e. ncvar$1()
522  */
523  if (mystride[maxidim] == 1
524  && mymap[maxidim] == 1)
525  {
526  iocount[maxidim] = myedges[maxidim];
527  mystride[maxidim] = (ptrdiff_t) myedges[maxidim];
528  mymap[maxidim] = (ptrdiff_t) length[maxidim];
529  }
530 
531  /*
532  * Perform I/O. Exit when done.
533  */
534  for (;;)
535  {
536  /* TODO: */
537  int lstatus = NC_get_vara(ncid, varid, mystart, iocount,
538  value, memtype);
539  if (lstatus != NC_NOERR) {
540  if(status == NC_NOERR || lstatus != NC_ERANGE)
541  status = lstatus;
542  }
543  /*
544  * The following code permutes through the variable s
545  * external start-index space and it s internal address
546  * space. At the UPC, this algorithm is commonly
547  * called "odometer code".
548  */
549  idim = maxidim;
550  carry:
551  value += (((int)mymap[idim]) * memtypelen);
552  mystart[idim] += (size_t)mystride[idim];
553  if (mystart[idim] == stop[idim])
554  {
555  size_t l = (length[idim] * (size_t)memtypelen);
556  value -= l;
557  mystart[idim] = start[idim];
558  if (--idim < 0)
559  break; /* normal return */
560  goto carry;
561  }
562  } /* I/O loop */
563  done:
564  free(mystart);
565  } /* variable is array */
566  return status;
567 }
568 
601 static int
602 NC_get_vars(int ncid, int varid, const size_t *start,
603  const size_t *edges, const ptrdiff_t *stride, void *value,
604  nc_type memtype)
605 {
606  NC* ncp;
607  int stat = NC_check_id(ncid, &ncp);
608 
609  if(stat != NC_NOERR) return stat;
610 #ifdef USE_NETCDF4
611  if(memtype >= NC_FIRSTUSERTYPEID) memtype = NC_NAT;
612 #endif
613  return ncp->dispatch->get_vars(ncid,varid,start,edges,stride,value,memtype);
614 }
615 
652 static int
653 NC_get_varm(int ncid, int varid, const size_t *start,
654  const size_t *edges, const ptrdiff_t *stride, const ptrdiff_t* map,
655  void *value, nc_type memtype)
656 {
657  NC* ncp;
658  int stat = NC_check_id(ncid, &ncp);
659 
660  if(stat != NC_NOERR) return stat;
661 #ifdef USE_NETCDF4
662  if(memtype >= NC_FIRSTUSERTYPEID) memtype = NC_NAT;
663 #endif
664  return ncp->dispatch->get_varm(ncid,varid,start,edges,stride,map,value,memtype);
665 }
666  /* All these functions are part of this named group... */
671 
746 int
747 nc_get_vara(int ncid, int varid, const size_t *startp,
748  const size_t *countp, void *ip)
749 {
750  NC* ncp = NULL;
751  nc_type xtype = NC_NAT;
752  int stat = NC_check_id(ncid, &ncp);
753  if(stat != NC_NOERR) return stat;
754  stat = nc_inq_vartype(ncid, varid, &xtype);
755  if(stat != NC_NOERR) return stat;
756  return NC_get_vara(ncid, varid, startp, countp, ip, xtype);
757 }
758 
759 int
760 nc_get_vara_text(int ncid, int varid, const size_t *startp,
761  const size_t *countp, char *ip)
762 {
763  NC* ncp;
764  int stat = NC_check_id(ncid, &ncp);
765  if(stat != NC_NOERR) return stat;
766  return NC_get_vara(ncid, varid, startp, countp,
767  (void *)ip, NC_CHAR);
768 }
769 
770 int
771 nc_get_vara_schar(int ncid, int varid, const size_t *startp,
772  const size_t *countp, signed char *ip)
773 {
774  NC* ncp;
775  int stat = NC_check_id(ncid, &ncp);
776  if(stat != NC_NOERR) return stat;
777  return NC_get_vara(ncid, varid, startp, countp,
778  (void *)ip, NC_BYTE);
779 }
780 
781 int
782 nc_get_vara_uchar(int ncid, int varid, const size_t *startp,
783  const size_t *countp, unsigned char *ip)
784 {
785  NC* ncp;
786  int stat = NC_check_id(ncid, &ncp);
787  if(stat != NC_NOERR) return stat;
788  return NC_get_vara(ncid, varid, startp, countp,
789  (void *)ip, T_uchar);
790 }
791 
792 int
793 nc_get_vara_short(int ncid, int varid, const size_t *startp,
794  const size_t *countp, short *ip)
795 {
796  NC* ncp;
797  int stat = NC_check_id(ncid, &ncp);
798  if(stat != NC_NOERR) return stat;
799  return NC_get_vara(ncid, varid, startp, countp,
800  (void *)ip, NC_SHORT);
801 }
802 
803 int
804 nc_get_vara_int(int ncid, int varid,
805  const size_t *startp, const size_t *countp, int *ip)
806 {
807  NC* ncp;
808  int stat = NC_check_id(ncid, &ncp);
809  if(stat != NC_NOERR) return stat;
810  return NC_get_vara(ncid,varid,startp,countp, (void *)ip,NC_INT);
811 }
812 
813 int
814 nc_get_vara_long(int ncid, int varid,
815  const size_t *startp, const size_t *countp, long *ip)
816 {
817  NC* ncp;
818  int stat = NC_check_id(ncid, &ncp);
819  if(stat != NC_NOERR) return stat;
820  return NC_get_vara(ncid,varid,startp,countp, (void *)ip,T_long);
821 }
822 
823 int
824 nc_get_vara_float(int ncid, int varid,
825  const size_t *startp, const size_t *countp, float *ip)
826 {
827  NC* ncp;
828  int stat = NC_check_id(ncid, &ncp);
829  if(stat != NC_NOERR) return stat;
830  return NC_get_vara(ncid,varid,startp,countp, (void *)ip,T_float);
831 }
832 
833 
834 int
835 nc_get_vara_double(int ncid, int varid, const size_t *startp,
836  const size_t *countp, double *ip)
837 {
838  NC* ncp;
839  int stat = NC_check_id(ncid, &ncp);
840  if(stat != NC_NOERR) return stat;
841  return NC_get_vara(ncid,varid,startp,countp, (void *)ip,T_double);
842 }
843 
844 int
845 nc_get_vara_ubyte(int ncid, int varid,
846  const size_t *startp, const size_t *countp, unsigned char *ip)
847 {
848  NC* ncp;
849  int stat = NC_check_id(ncid, &ncp);
850  if(stat != NC_NOERR) return stat;
851  return NC_get_vara(ncid,varid,startp,countp, (void *)ip,T_ubyte);
852 }
853 
854 int
855 nc_get_vara_ushort(int ncid, int varid,
856  const size_t *startp, const size_t *countp, unsigned 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_vara(ncid,varid,startp,countp, (void *)ip,T_ushort);
862 }
863 
864 int
865 nc_get_vara_uint(int ncid, int varid,
866  const size_t *startp, const size_t *countp, unsigned int *ip)
867 {
868  NC* ncp;
869  int stat = NC_check_id(ncid, &ncp);
870  if(stat != NC_NOERR) return stat;
871  return NC_get_vara(ncid,varid,startp,countp, (void *)ip,T_uint);
872 }
873 
874 int
875 nc_get_vara_longlong(int ncid, int varid,
876  const size_t *startp, const size_t *countp, long long *ip)
877 {
878  NC* ncp;
879  int stat = NC_check_id(ncid, &ncp);
880  if(stat != NC_NOERR) return stat;
881  return NC_get_vara(ncid,varid,startp,countp, (void *)ip,T_longlong);
882 }
883 
884 int
885 nc_get_vara_ulonglong(int ncid, int varid,
886  const size_t *startp, const size_t *countp, unsigned long long *ip)
887 {
888  NC* ncp;
889  int stat = NC_check_id(ncid, &ncp);
890  if(stat != NC_NOERR) return stat;
891  return NC_get_vara(ncid,varid,startp,countp, (void *)ip,NC_UINT64);
892 }
893 
894 #ifdef USE_NETCDF4
895 int
896 nc_get_vara_string(int ncid, int varid,
897  const size_t *startp, const size_t *countp, char* *ip)
898 {
899  NC* ncp;
900  int stat = NC_check_id(ncid, &ncp);
901  if(stat != NC_NOERR) return stat;
902  return NC_get_vara(ncid,varid,startp,countp, (void *)ip,NC_STRING);
903 }
904 
905 #endif /*USE_NETCDF4*/
906 
942 int
943 nc_get_var1(int ncid, int varid, const size_t *indexp, void *ip)
944 {
945  return NC_get_var1(ncid, varid, indexp, ip, NC_NAT);
946 }
947 
948 int
949 nc_get_var1_text(int ncid, int varid, const size_t *indexp, char *ip)
950 {
951  NC* ncp;
952  int stat = NC_check_id(ncid, &ncp);
953  if(stat != NC_NOERR) return stat;
954  return NC_get_var1(ncid, varid, indexp, (void *)ip, NC_CHAR);
955 }
956 
957 int
958 nc_get_var1_schar(int ncid, int varid, const size_t *indexp, signed char *ip)
959 {
960  NC* ncp;
961  int stat = NC_check_id(ncid, &ncp);
962  if(stat != NC_NOERR) return stat;
963  return NC_get_var1(ncid, varid, indexp, (void *)ip, NC_BYTE);
964 }
965 
966 int
967 nc_get_var1_uchar(int ncid, int varid, const size_t *indexp, unsigned char *ip)
968 {
969  NC* ncp;
970  int stat = NC_check_id(ncid, &ncp);
971  if(stat != NC_NOERR) return stat;
972  return NC_get_var1(ncid, varid, indexp, (void *)ip, NC_UBYTE);
973 }
974 
975 int
976 nc_get_var1_short(int ncid, int varid, const size_t *indexp, short *ip)
977 {
978  NC* ncp;
979  int stat = NC_check_id(ncid, &ncp);
980  if(stat != NC_NOERR) return stat;
981  return NC_get_var1(ncid, varid, indexp, (void *)ip, NC_SHORT);
982 }
983 
984 int
985 nc_get_var1_int(int ncid, int varid, const size_t *indexp, int *ip)
986 {
987  NC* ncp;
988  int stat = NC_check_id(ncid, &ncp);
989  if(stat != NC_NOERR) return stat;
990  return NC_get_var1(ncid, varid, indexp, (void *)ip, NC_INT);
991 }
992 
993 int
994 nc_get_var1_long(int ncid, int varid, const size_t *indexp,
995  long *ip)
996 {
997  NC* ncp;
998  int stat = NC_check_id(ncid, &ncp);
999  if(stat != NC_NOERR) return stat;
1000  return NC_get_var1(ncid, varid, indexp, (void *)ip, longtype);
1001 }
1002 
1003 int
1004 nc_get_var1_float(int ncid, int varid, const size_t *indexp,
1005  float *ip)
1006 {
1007  NC* ncp;
1008  int stat = NC_check_id(ncid, &ncp);
1009  if(stat != NC_NOERR) return stat;
1010  return NC_get_var1(ncid, varid, indexp, (void *)ip, NC_FLOAT);
1011 }
1012 
1013 int
1014 nc_get_var1_double(int ncid, int varid, const size_t *indexp,
1015  double *ip)
1016 {
1017  NC* ncp;
1018  int stat = NC_check_id(ncid, &ncp);
1019  if(stat != NC_NOERR) return stat;
1020  return NC_get_var1(ncid, varid, indexp, (void *)ip, NC_DOUBLE);
1021 }
1022 
1023 int
1024 nc_get_var1_ubyte(int ncid, int varid, const size_t *indexp,
1025  unsigned char *ip)
1026 {
1027  NC* ncp;
1028  int stat = NC_check_id(ncid, &ncp);
1029  if(stat != NC_NOERR) return stat;
1030  return NC_get_var1(ncid, varid, indexp, (void *)ip, NC_UBYTE);
1031 }
1032 
1033 int
1034 nc_get_var1_ushort(int ncid, int varid, const size_t *indexp,
1035  unsigned short *ip)
1036 {
1037  NC* ncp;
1038  int stat = NC_check_id(ncid, &ncp);
1039  if(stat != NC_NOERR) return stat;
1040  return NC_get_var1(ncid, varid, indexp, (void *)ip, NC_USHORT);
1041 }
1042 
1043 int
1044 nc_get_var1_uint(int ncid, int varid, const size_t *indexp,
1045  unsigned int *ip)
1046 {
1047  NC* ncp;
1048  int stat = NC_check_id(ncid, &ncp);
1049  if(stat != NC_NOERR) return stat;
1050  return NC_get_var1(ncid, varid, indexp, (void *)ip, NC_UINT);
1051 }
1052 
1053 int
1054 nc_get_var1_longlong(int ncid, int varid, const size_t *indexp,
1055  long long *ip)
1056 {
1057  NC* ncp;
1058  int stat = NC_check_id(ncid, &ncp);
1059  if(stat != NC_NOERR) return stat;
1060  return NC_get_var1(ncid, varid, indexp, (void *)ip, NC_INT64);
1061 }
1062 
1063 int
1064 nc_get_var1_ulonglong(int ncid, int varid, const size_t *indexp,
1065  unsigned long long *ip)
1066 {
1067  NC* ncp;
1068  int stat = NC_check_id(ncid, &ncp);
1069  if(stat != NC_NOERR) return stat;
1070  return NC_get_var1(ncid, varid, indexp, (void *)ip, NC_UINT64);
1071 }
1072 
1073 #ifdef USE_NETCDF4
1074 int
1075 nc_get_var1_string(int ncid, int varid, const size_t *indexp, char* *ip)
1076 {
1077  NC* ncp;
1078  int stat = NC_check_id(ncid, &ncp);
1079  if(stat != NC_NOERR) return stat;
1080  return NC_get_var1(ncid, varid, indexp, (void *)ip, NC_STRING);
1081 }
1082 #endif /*USE_NETCDF4*/
1083 
1128 int
1129 nc_get_var(int ncid, int varid, void *ip)
1130 {
1131  return NC_get_var(ncid, varid, ip, NC_NAT);
1132 }
1133 
1134 int
1135 nc_get_var_text(int ncid, int varid, char *ip)
1136 {
1137  NC *ncp;
1138  int stat = NC_check_id(ncid, &ncp);
1139  if(stat != NC_NOERR) return stat;
1140  return NC_get_var(ncid, varid, (void *)ip, NC_CHAR);
1141 }
1142 
1143 int
1144 nc_get_var_schar(int ncid, int varid, signed char *ip)
1145 {
1146  NC *ncp;
1147  int stat = NC_check_id(ncid, &ncp);
1148  if(stat != NC_NOERR) return stat;
1149  return NC_get_var(ncid, varid, (void *)ip, NC_BYTE);
1150 }
1151 
1152 int
1153 nc_get_var_uchar(int ncid, int varid, unsigned char *ip)
1154 {
1155  NC *ncp;
1156  int stat = NC_check_id(ncid, &ncp);
1157  if(stat != NC_NOERR) return stat;
1158  return NC_get_var(ncid,varid, (void *)ip, NC_UBYTE);
1159 }
1160 
1161 int
1162 nc_get_var_short(int ncid, int varid, short *ip)
1163 {
1164  NC* ncp;
1165  int stat = NC_check_id(ncid, &ncp);
1166  if(stat != NC_NOERR) return stat;
1167  return NC_get_var(ncid, varid, (void *)ip, NC_SHORT);
1168 }
1169 
1170 int
1171 nc_get_var_int(int ncid, int varid, int *ip)
1172 {
1173  NC* ncp;
1174  int stat = NC_check_id(ncid, &ncp);
1175  if(stat != NC_NOERR) return stat;
1176  return NC_get_var(ncid,varid, (void *)ip, NC_INT);
1177 }
1178 
1179 int
1180 nc_get_var_long(int ncid, int varid, long *ip)
1181 {
1182  NC* ncp;
1183  int stat = NC_check_id(ncid, &ncp);
1184  if(stat != NC_NOERR) return stat;
1185  return NC_get_var(ncid,varid, (void *)ip, longtype);
1186 }
1187 
1188 int
1189 nc_get_var_float(int ncid, int varid, float *ip)
1190 {
1191  NC* ncp;
1192  int stat = NC_check_id(ncid, &ncp);
1193  if(stat != NC_NOERR) return stat;
1194  return NC_get_var(ncid,varid, (void *)ip, NC_FLOAT);
1195 }
1196 
1197 int
1198 nc_get_var_double(int ncid, int varid, double *ip)
1199 {
1200  NC* ncp;
1201  int stat = NC_check_id(ncid, &ncp);
1202  if(stat != NC_NOERR) return stat;
1203  return NC_get_var(ncid,varid, (void *)ip, NC_DOUBLE);
1204 }
1205 
1206 int
1207 nc_get_var_ubyte(int ncid, int varid, unsigned char *ip)
1208 {
1209  NC* ncp;
1210  int stat = NC_check_id(ncid, &ncp);
1211  if(stat != NC_NOERR) return stat;
1212  return NC_get_var(ncid,varid, (void *)ip, NC_UBYTE);
1213 }
1214 
1215 int
1216 nc_get_var_ushort(int ncid, int varid, unsigned short *ip)
1217 {
1218  NC* ncp;
1219  int stat = NC_check_id(ncid, &ncp);
1220  if(stat != NC_NOERR) return stat;
1221  return NC_get_var(ncid,varid, (void *)ip, NC_USHORT);
1222 }
1223 
1224 int
1225 nc_get_var_uint(int ncid, int varid, unsigned int *ip)
1226 {
1227  NC* ncp;
1228  int stat = NC_check_id(ncid, &ncp);
1229  if(stat != NC_NOERR) return stat;
1230  return NC_get_var(ncid,varid, (void *)ip, NC_UINT);
1231 }
1232 
1233 int
1234 nc_get_var_longlong(int ncid, int varid, long long *ip)
1235 {
1236  NC* ncp;
1237  int stat = NC_check_id(ncid, &ncp);
1238  if(stat != NC_NOERR) return stat;
1239  return NC_get_var(ncid,varid, (void *)ip, NC_INT64);
1240 }
1241 
1242 int
1243 nc_get_var_ulonglong(int ncid, int varid, unsigned long long *ip)
1244 {
1245  NC* ncp;
1246  int stat = NC_check_id(ncid, &ncp);
1247  if(stat != NC_NOERR) return stat;
1248  return NC_get_var(ncid,varid, (void *)ip,NC_UINT64);
1249 }
1250 
1251 #ifdef USE_NETCDF4
1252 int
1253 nc_get_var_string(int ncid, int varid, char* *ip)
1254 {
1255  NC* ncp;
1256  int stat = NC_check_id(ncid, &ncp);
1257  if(stat != NC_NOERR) return stat;
1258  return NC_get_var(ncid,varid, (void *)ip,NC_STRING);
1259 }
1260 #endif /*USE_NETCDF4*/
1261 
1303 int
1304 nc_get_vars (int ncid, int varid, const size_t * startp,
1305  const size_t * countp, const ptrdiff_t * stridep,
1306  void *ip)
1307 {
1308  NC* ncp;
1309  int stat = NC_NOERR;
1310 
1311  if ((stat = NC_check_id(ncid, &ncp)))
1312  return stat;
1313  return ncp->dispatch->get_vars(ncid, varid, startp, countp, stridep,
1314  ip, NC_NAT);
1315 }
1316 
1317 int
1318 nc_get_vars_text(int ncid, int varid, const size_t *startp,
1319  const size_t *countp, const ptrdiff_t * stridep,
1320  char *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, NC_CHAR);
1327 }
1328 
1329 int
1330 nc_get_vars_schar(int ncid, int varid, const size_t *startp,
1331  const size_t *countp, const ptrdiff_t * stridep,
1332  signed char *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, NC_BYTE);
1339 }
1340 
1341 int
1342 nc_get_vars_uchar(int ncid, int varid, const size_t *startp,
1343  const size_t *countp, const ptrdiff_t * stridep,
1344  unsigned char *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, T_uchar);
1351 }
1352 
1353 int
1354 nc_get_vars_short(int ncid, int varid, const size_t *startp,
1355  const size_t *countp, const ptrdiff_t *stridep,
1356  short *ip)
1357 {
1358  NC* ncp;
1359  int stat = NC_check_id(ncid, &ncp);
1360  if(stat != NC_NOERR) return stat;
1361  return NC_get_vars(ncid,varid,startp, countp, stridep,
1362  (void *)ip, NC_SHORT);
1363 }
1364 
1365 int
1366 nc_get_vars_int(int ncid, int varid, const size_t *startp,
1367  const size_t *countp, const ptrdiff_t * stridep,
1368  int *ip)
1369 {
1370  NC* ncp;
1371  int stat = NC_check_id(ncid, &ncp);
1372  if(stat != NC_NOERR) return stat;
1373  return NC_get_vars(ncid,varid,startp, countp, stridep,
1374  (void *)ip, NC_INT);
1375 }
1376 
1377 int
1378 nc_get_vars_long(int ncid, int varid, const size_t *startp,
1379  const size_t *countp, const ptrdiff_t * stridep,
1380  long *ip)
1381 {
1382  NC* ncp;
1383  int stat = NC_check_id(ncid, &ncp);
1384  if(stat != NC_NOERR) return stat;
1385  return NC_get_vars(ncid,varid,startp, countp, stridep,
1386  (void *)ip, T_long);
1387 }
1388 
1389 int
1390 nc_get_vars_float(int ncid, int varid, const size_t *startp,
1391  const size_t *countp, const ptrdiff_t * stridep,
1392  float *ip)
1393 {
1394  NC* ncp;
1395  int stat = NC_check_id(ncid, &ncp);
1396  if(stat != NC_NOERR) return stat;
1397  return NC_get_vars(ncid,varid,startp, countp, stridep,
1398  (void *)ip, T_float);
1399 }
1400 
1401 int
1402 nc_get_vars_double(int ncid, int varid, const size_t *startp,
1403  const size_t *countp, const ptrdiff_t * stridep,
1404  double *ip)
1405 {
1406  NC* ncp;
1407  int stat = NC_check_id(ncid, &ncp);
1408  if(stat != NC_NOERR) return stat;
1409  return NC_get_vars(ncid,varid,startp, countp, stridep,
1410  (void *)ip, T_double);
1411 }
1412 
1413 int
1414 nc_get_vars_ubyte(int ncid, int varid, const size_t *startp,
1415  const size_t *countp, const ptrdiff_t * stridep,
1416  unsigned char *ip)
1417 {
1418  NC* ncp;
1419  int stat = NC_check_id(ncid, &ncp);
1420  if(stat != NC_NOERR) return stat;
1421  return NC_get_vars(ncid,varid, startp, countp, stridep,
1422  (void *)ip, T_ubyte);
1423 }
1424 
1425 int
1426 nc_get_vars_ushort(int ncid, int varid, const size_t *startp,
1427  const size_t *countp, const ptrdiff_t * stridep,
1428  unsigned short *ip)
1429 {
1430  NC* ncp;
1431  int stat = NC_check_id(ncid, &ncp);
1432  if(stat != NC_NOERR) return stat;
1433  return NC_get_vars(ncid,varid,startp,countp, stridep,
1434  (void *)ip, T_ushort);
1435 }
1436 
1437 int
1438 nc_get_vars_uint(int ncid, int varid, const size_t *startp,
1439  const size_t *countp, const ptrdiff_t * stridep,
1440  unsigned int *ip)
1441 {
1442  NC* ncp;
1443  int stat = NC_check_id(ncid, &ncp);
1444  if(stat != NC_NOERR) return stat;
1445  return NC_get_vars(ncid,varid,startp, countp, stridep,
1446  (void *)ip, T_uint);
1447 }
1448 
1449 int
1450 nc_get_vars_longlong(int ncid, int varid, const size_t *startp,
1451  const size_t *countp, const ptrdiff_t * stridep,
1452  long long *ip)
1453 {
1454  NC* ncp;
1455  int stat = NC_check_id(ncid, &ncp);
1456  if(stat != NC_NOERR) return stat;
1457  return NC_get_vars(ncid, varid, startp, countp, stridep,
1458  (void *)ip, T_longlong);
1459 }
1460 
1461 int
1462 nc_get_vars_ulonglong(int ncid, int varid, const size_t *startp,
1463  const size_t *countp, const ptrdiff_t * stridep,
1464  unsigned long long *ip)
1465 {
1466  NC* ncp;
1467  int stat = NC_check_id(ncid, &ncp);
1468  if(stat != NC_NOERR) return stat;
1469  return NC_get_vars(ncid, varid, startp, countp, stridep,
1470  (void *)ip, NC_UINT64);
1471 }
1472 
1473 #ifdef USE_NETCDF4
1474 int
1475 nc_get_vars_string(int ncid, int varid,
1476  const size_t *startp, const size_t *countp,
1477  const ptrdiff_t * stridep,
1478  char* *ip)
1479 {
1480  NC* ncp;
1481  int stat = NC_check_id(ncid, &ncp);
1482  if(stat != NC_NOERR) return stat;
1483  return NC_get_vars(ncid, varid, startp, countp, stridep,
1484  (void *)ip, NC_STRING);
1485 }
1486 #endif /*USE_NETCDF4*/
1487 
1544 int
1545 nc_get_varm(int ncid, int varid, const size_t * startp,
1546  const size_t * countp, const ptrdiff_t * stridep,
1547  const ptrdiff_t * imapp, void *ip)
1548 {
1549  NC* ncp;
1550  int stat = NC_NOERR;
1551 
1552  if ((stat = NC_check_id(ncid, &ncp)))
1553  return stat;
1554  return ncp->dispatch->get_varm(ncid, varid, startp, countp,
1555  stridep, imapp, ip, NC_NAT);
1556 }
1557 
1558 int
1559 nc_get_varm_schar(int ncid, int varid,
1560  const size_t *startp, const size_t *countp,
1561  const ptrdiff_t *stridep,
1562  const ptrdiff_t *imapp, signed char *ip)
1563 {
1564  NC *ncp;
1565  int stat = NC_check_id(ncid, &ncp);
1566  if(stat != NC_NOERR) return stat;
1567  return NC_get_varm(ncid, varid, startp, countp,
1568  stridep, imapp, (void *)ip, NC_BYTE);
1569 }
1570 
1571 int
1572 nc_get_varm_uchar(int ncid, int varid,
1573  const size_t *startp, const size_t *countp,
1574  const ptrdiff_t *stridep, const ptrdiff_t *imapp,
1575  unsigned char *ip)
1576 {
1577  NC *ncp;
1578  int stat = NC_check_id(ncid, &ncp);
1579  if(stat != NC_NOERR) return stat;
1580  return NC_get_varm(ncid,varid,startp,countp,stridep,imapp, (void *)ip,T_uchar);
1581 }
1582 
1583 int
1584 nc_get_varm_short(int ncid, int varid, const size_t *startp,
1585  const size_t *countp, const ptrdiff_t *stridep,
1586  const ptrdiff_t *imapp, short *ip)
1587 {
1588  NC *ncp;
1589  int stat = NC_check_id(ncid, &ncp);
1590  if(stat != NC_NOERR) return stat;
1591  return NC_get_varm(ncid,varid,startp,countp,stridep,imapp, (void *)ip,NC_SHORT);
1592 }
1593 
1594 int
1595 nc_get_varm_int(int ncid, int varid,
1596  const size_t *startp, const size_t *countp,
1597  const ptrdiff_t *stridep, const ptrdiff_t *imapp,
1598  int *ip)
1599 {
1600  NC *ncp;
1601  int stat = NC_check_id(ncid, &ncp);
1602  if(stat != NC_NOERR) return stat;
1603  return NC_get_varm(ncid,varid,startp,countp,stridep,imapp, (void *)ip,NC_INT);
1604 }
1605 
1606 int
1607 nc_get_varm_long(int ncid, int varid,
1608  const size_t *startp, const size_t *countp,
1609  const ptrdiff_t *stridep, const ptrdiff_t *imapp,
1610  long *ip)
1611 {
1612  NC *ncp;
1613  int stat = NC_check_id(ncid, &ncp);
1614  if(stat != NC_NOERR) return stat;
1615  return NC_get_varm(ncid,varid,startp,countp,stridep,imapp, (void *)ip,T_long);
1616 }
1617 
1618 int
1619 nc_get_varm_float(int ncid, int varid,
1620  const size_t *startp, const size_t *countp,
1621  const ptrdiff_t *stridep, const ptrdiff_t *imapp,
1622  float *ip)
1623 {
1624  NC *ncp;
1625  int stat = NC_check_id(ncid, &ncp);
1626  if(stat != NC_NOERR) return stat;
1627  return NC_get_varm(ncid,varid,startp,countp,stridep,imapp, (void *)ip,T_float);
1628 }
1629 
1630 int
1631 nc_get_varm_double(int ncid, int varid,
1632  const size_t *startp, const size_t *countp,
1633  const ptrdiff_t *stridep, const ptrdiff_t *imapp,
1634  double *ip)
1635 {
1636  NC *ncp;
1637  int stat = NC_check_id(ncid, &ncp);
1638  if(stat != NC_NOERR) return stat;
1639  return NC_get_varm(ncid,varid,startp,countp,stridep,imapp, (void *)ip,T_double);
1640 }
1641 
1642 int
1643 nc_get_varm_ubyte(int ncid, int varid,
1644  const size_t *startp, const size_t *countp,
1645  const ptrdiff_t *stridep, const ptrdiff_t *imapp,
1646  unsigned char *ip)
1647 {
1648  NC *ncp;
1649  int stat = NC_check_id(ncid, &ncp);
1650  if(stat != NC_NOERR) return stat;
1651  return NC_get_varm(ncid,varid,startp,countp,stridep,
1652  imapp, (void *)ip, T_ubyte);
1653 }
1654 
1655 int
1656 nc_get_varm_ushort(int ncid, int varid,
1657  const size_t *startp, const size_t *countp,
1658  const ptrdiff_t *stridep, const ptrdiff_t *imapp,
1659  unsigned short *ip)
1660 {
1661  NC *ncp;
1662  int stat = NC_check_id(ncid, &ncp);
1663  if(stat != NC_NOERR) return stat;
1664  return NC_get_varm(ncid, varid, startp, countp, stridep,
1665  imapp, (void *)ip, T_ushort);
1666 }
1667 
1668 int
1669 nc_get_varm_uint(int ncid, int varid,
1670  const size_t *startp, const size_t *countp,
1671  const ptrdiff_t *stridep, const ptrdiff_t *imapp,
1672  unsigned int *ip)
1673 {
1674  NC *ncp;
1675  int stat = NC_check_id(ncid, &ncp);
1676  if(stat != NC_NOERR) return stat;
1677  return NC_get_varm(ncid, varid, startp, countp,
1678  stridep, imapp, (void *)ip, T_uint);
1679 }
1680 
1681 int
1682 nc_get_varm_longlong(int ncid, int varid, const size_t *startp,
1683  const size_t *countp, const ptrdiff_t *stridep,
1684  const ptrdiff_t *imapp, long long *ip)
1685 {
1686  NC *ncp;
1687  int stat = NC_check_id(ncid, &ncp);
1688  if(stat != NC_NOERR) return stat;
1689  return NC_get_varm(ncid, varid, startp, countp, stridep, imapp,
1690  (void *)ip, T_longlong);
1691 }
1692 
1693 int
1694 nc_get_varm_ulonglong(int ncid, int varid,
1695  const size_t *startp, const size_t *countp,
1696  const ptrdiff_t *stridep, const ptrdiff_t *imapp,
1697  unsigned long long *ip)
1698 {
1699  NC *ncp;
1700  int stat = NC_check_id(ncid, &ncp);
1701  if(stat != NC_NOERR) return stat;
1702  return NC_get_varm(ncid, varid, startp, countp, stridep, imapp,
1703  (void *)ip, NC_UINT64);
1704 }
1705 
1706 int
1707 nc_get_varm_text(int ncid, int varid, const size_t *startp,
1708  const size_t *countp, const ptrdiff_t *stridep,
1709  const ptrdiff_t *imapp, char *ip)
1710 {
1711  NC *ncp;
1712  int stat = NC_check_id(ncid, &ncp);
1713  if(stat != NC_NOERR) return stat;
1714  return NC_get_varm(ncid, varid, startp, countp, stridep, imapp,
1715  (void *)ip, NC_CHAR);
1716 }
1717 
1718 #ifdef USE_NETCDF4
1719 int
1720 nc_get_varm_string(int ncid, int varid, const size_t *startp,
1721  const size_t *countp, const ptrdiff_t *stridep,
1722  const ptrdiff_t *imapp, char **ip)
1723 {
1724  NC *ncp;
1725  int stat = NC_check_id(ncid, &ncp);
1726  if(stat != NC_NOERR) return stat;
1727  return NC_get_varm(ncid, varid, startp, countp, stridep, imapp,
1728  (void *)ip, NC_STRING);
1729 }
1731 #endif /*USE_NETCDF4*/
1732 
1733  /* 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:865
int nc_get_var_uint(int ncid, int varid, unsigned int *ip)
Read an entire variable in one call.
Definition: dvarget.c:1225
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:949
#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:1243
#define NC_CHAR
ISO/ASCII character.
Definition: netcdf.h:35
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:1584
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:1643
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:835
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:1619
#define NC_UBYTE
unsigned 1 byte int
Definition: netcdf.h:41
#define NC_EMAPTYPE
Mapped access for atomic types only.
Definition: netcdf.h:447
#define NC_ERANGE
Math result not representable.
Definition: netcdf.h:394
#define NC_MAX_VAR_DIMS
max per variable dimensions
Definition: netcdf.h:266
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:1318
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:1414
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:1075
#define NC_UINT
unsigned 4-byte int
Definition: netcdf.h:43
int nc_get_var_long(int ncid, int varid, long *ip)
Read an entire variable in one call.
Definition: dvarget.c:1180
#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:1559
static int NC_get_var(int ncid, int varid, void *value, nc_type memtype)
Get data for a variable.
Definition: dvarget.c:146
#define NC_INT64
signed 8-byte int
Definition: netcdf.h:44
#define NC_STRING
string
Definition: netcdf.h:46
#define NC_DOUBLE
double precision floating point number
Definition: netcdf.h:40
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:1402
EXTERNL int nc_inq_varndims(int ncid, int varid, int *ndimsp)
Learn how many dimensions are associated with a variable.
Definition: dvarinq.c:202
int nc_get_var_schar(int ncid, int varid, signed char *ip)
Read an entire variable in one call.
Definition: dvarget.c:1144
static int NC_get_varm(int ncid, int varid, const size_t *start, const size_t *edges, const ptrdiff_t *stride, const ptrdiff_t *map, void *value, nc_type memtype)
Called by externally visible nc_get_varm_xxx routines.
Definition: dvarget.c:653
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:1545
int nc_type
The nc_type type is just an int.
Definition: netcdf.h:24
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:896
#define NC_BYTE
signed 1 byte integer
Definition: netcdf.h:34
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:1054
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:1595
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:1450
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:855
int nc_get_var(int ncid, int varid, void *ip)
Read an entire variable in one call.
Definition: dvarget.c:1129
int nc_get_var_int(int ncid, int varid, int *ip)
Read an entire variable in one call.
Definition: dvarget.c:1171
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:793
int nc_get_var_ushort(int ncid, int varid, unsigned short *ip)
Read an entire variable in one call.
Definition: dvarget.c:1216
int nc_get_var_double(int ncid, int varid, double *ip)
Read an entire variable in one call.
Definition: dvarget.c:1198
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:824
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:1669
int nc_get_var_string(int ncid, int varid, char **ip)
Read an entire variable in one call.
Definition: dvarget.c:1253
#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:1024
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:967
int nc_get_var1(int ncid, int varid, const size_t *indexp, void *ip)
Read a single datum from a variable.
Definition: dvarget.c:943
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:804
#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:1044
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:875
#define NC_INT
signed 4 byte integer
Definition: netcdf.h:37
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:885
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:1342
int nc_get_var_text(int ncid, int varid, char *ip)
Read an entire variable in one call.
Definition: dvarget.c:1135
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:1572
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:1462
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:1366
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:845
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:1004
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:760
#define NC_NAT
Not A Type.
Definition: netcdf.h:33
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:771
EXTERNL int nc_inq_vartype(int ncid, int varid, nc_type *xtypep)
Learn the type of a variable.
Definition: dvarinq.c:178
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:1390
EXTERNL int nc_inq_type(int ncid, nc_type xtype, char *name, size_t *size)
Inquire about a type.
Definition: dfile.c:1631
#define NC_USHORT
unsigned 2-byte int
Definition: netcdf.h:42
int nc_get_var_ubyte(int ncid, int varid, unsigned char *ip)
Read an entire variable in one call.
Definition: dvarget.c:1207
int nc_get_var_longlong(int ncid, int varid, long long *ip)
Read an entire variable in one call.
Definition: dvarget.c:1234
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:1354
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:1034
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:1707
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:958
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:1330
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:1378
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:1426
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:782
int nc_get_var_float(int ncid, int varid, float *ip)
Read an entire variable in one call.
Definition: dvarget.c:1189
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:976
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:1304
int nc_get_var_short(int ncid, int varid, short *ip)
Read an entire variable in one call.
Definition: dvarget.c:1162
#define NC_SHORT
signed 2 byte integer
Definition: netcdf.h:36
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:1064
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:1014
int nc_get_var_uchar(int ncid, int varid, unsigned char *ip)
Read an entire variable in one call.
Definition: dvarget.c:1153
#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:994
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:1607
static int NC_get_vars(int ncid, int varid, const size_t *start, const size_t *edges, const ptrdiff_t *stride, void *value, nc_type memtype)
Called by externally visible nc_get_vars_xxx routines.
Definition: dvarget.c:602
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:985
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:1656
#define NC_FLOAT
single precision floating point number
Definition: netcdf.h:39
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:1720
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:1631
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:747
#define NC_UINT64
unsigned 8-byte int
Definition: netcdf.h:45
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:814
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:1682
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:1475
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:1438
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:1694

Return to the Main Unidata NetCDF page.
Generated on Fri May 11 2018 21:22:25 for NetCDF. NetCDF is a Unidata library.