NetCDF  4.7.0
dvarput.c
Go to the documentation of this file.
1 
8 #include "ncdispatch.h"
9 
10 struct PUTodometer {
11  int rank;
12  size_t index[NC_MAX_VAR_DIMS];
13  size_t start[NC_MAX_VAR_DIMS];
14  size_t edges[NC_MAX_VAR_DIMS];
15  ptrdiff_t stride[NC_MAX_VAR_DIMS];
16  size_t stop[NC_MAX_VAR_DIMS];
17 };
18 
29 static void
30 odom_init(struct PUTodometer* odom, int rank, const size_t* start,
31  const size_t* edges, const ptrdiff_t* stride)
32 {
33  int i;
34  memset(odom,0,sizeof(struct PUTodometer));
35  odom->rank = rank;
36  assert(odom->rank <= NC_MAX_VAR_DIMS);
37  for(i=0;i<odom->rank;i++) {
38  odom->start[i] = (start != NULL ? start[i] : 0);
39  odom->edges[i] = (edges != NULL ? edges[i] : 1);
40  odom->stride[i] = (stride != NULL ? stride[i] : 1);
41  odom->stop[i] = odom->start[i] + (odom->edges[i]*(size_t)odom->stride[i]);
42  odom->index[i] = odom->start[i];
43  }
44 }
45 
53 static int
54 odom_more(struct PUTodometer* odom)
55 {
56  return (odom->index[0] < odom->stop[0]);
57 }
58 
66 static int
67 odom_next(struct PUTodometer* odom)
68 {
69  int i;
70  if(odom->rank == 0) return 0;
71  for(i=odom->rank-1;i>=0;i--) {
72  odom->index[i] += (size_t)odom->stride[i];
73  if(odom->index[i] < odom->stop[i]) break;
74  if(i == 0) return 0; /* leave the 0th entry if it overflows*/
75  odom->index[i] = odom->start[i]; /* reset this position*/
76  }
77  return 1;
78 }
79 
83 static int
84 NC_put_vara(int ncid, int varid, const size_t *start,
85  const size_t *edges, const void *value, nc_type memtype)
86 {
87  NC* ncp;
88  size_t *my_count = (size_t *)edges;
89 
90  int stat = NC_check_id(ncid, &ncp);
91  if(stat != NC_NOERR) return stat;
92 
93  if(start == NULL || edges == NULL) {
94  stat = NC_check_nulls(ncid, varid, start, &my_count, NULL);
95  if(stat != NC_NOERR) return stat;
96  }
97  stat = ncp->dispatch->put_vara(ncid, varid, start, my_count, value, memtype);
98  if(edges == NULL) free(my_count);
99  return stat;
100 }
101 
105 static int
106 NC_put_var(int ncid, int varid, const void *value, nc_type memtype)
107 {
108  int ndims;
109  size_t shape[NC_MAX_VAR_DIMS];
110  int stat = nc_inq_varndims(ncid,varid, &ndims);
111  if(stat) return stat;
112  stat = NC_getshape(ncid,varid, ndims, shape);
113  if(stat) return stat;
114  return NC_put_vara(ncid, varid, NC_coord_zero, shape, value, memtype);
115 }
116 
120 static int
121 NC_put_var1(int ncid, int varid, const size_t *coord, const void* value,
122  nc_type memtype)
123 {
124  return NC_put_vara(ncid, varid, coord, NC_coord_one, value, memtype);
125 }
126 
130 int
131 NCDEFAULT_put_vars(int ncid, int varid, const size_t * start,
132  const size_t * edges, const ptrdiff_t * stride,
133  const void *value0, nc_type memtype)
134 {
135  /* Rebuilt put_vars code to simplify and avoid use of put_varm */
136 
137  int status = NC_NOERR;
138  int i,isstride1,isrecvar;
139  int rank;
140  struct PUTodometer odom;
141  nc_type vartype = NC_NAT;
142  NC* ncp;
143  size_t vartypelen;
144  size_t nels;
145  int memtypelen;
146  const char* value = (const char*)value0;
147  int nrecdims; /* number of record dims for a variable */
148  int is_recdim[NC_MAX_VAR_DIMS]; /* for variable's dimensions */
149  size_t varshape[NC_MAX_VAR_DIMS];
150  size_t mystart[NC_MAX_VAR_DIMS];
151  size_t myedges[NC_MAX_VAR_DIMS];
152  ptrdiff_t mystride[NC_MAX_VAR_DIMS];
153  const char* memptr = value;
154 
155  status = NC_check_id (ncid, &ncp);
156  if(status != NC_NOERR) return status;
157 
158  status = nc_inq_vartype(ncid, varid, &vartype);
159  if(status != NC_NOERR) return status;
160 
161  if(memtype == NC_NAT) memtype = vartype;
162 
163  /* compute the variable type size */
164  status = nc_inq_type(ncid,vartype,NULL,&vartypelen);
165  if(status != NC_NOERR) return status;
166 
167  if(memtype > NC_MAX_ATOMIC_TYPE)
168  memtypelen = (int)vartypelen;
169  else
170  memtypelen = nctypelen(memtype);
171 
172  /* Check gross internal/external type compatibility */
173  if(vartype != memtype) {
174  /* If !atomic, the two types must be the same */
175  if(vartype > NC_MAX_ATOMIC_TYPE
176  || memtype > NC_MAX_ATOMIC_TYPE)
177  return NC_EBADTYPE;
178  /* ok, the types differ but both are atomic */
179  if(memtype == NC_CHAR || vartype == NC_CHAR)
180  return NC_ECHAR;
181  }
182 
183  /* Get the variable rank */
184  status = nc_inq_varndims(ncid, varid, &rank);
185  if(status != NC_NOERR) return status;
186 
187  /* Start array is always required for non-scalar vars. */
188  if(rank > 0 && start == NULL)
189  return NC_EINVALCOORDS;
190 
191  /* Get variable dimension sizes */
192  status = NC_inq_recvar(ncid,varid,&nrecdims,is_recdim);
193  if(status != NC_NOERR) return status;
194  isrecvar = (nrecdims > 0);
195  NC_getshape(ncid,varid,rank,varshape);
196 
197  /* Optimize out using various checks */
198  if (rank == 0) {
199  /*
200  * The variable is a scalar; consequently,
201  * there is only one thing to get and only one place to put it.
202  * (Why was I called?)
203  */
204  size_t edge1[1] = {1};
205  return NC_put_vara(ncid, varid, start, edge1, value0, memtype);
206  }
207 
208  /* Do various checks and fixups on start/edges/stride */
209  isstride1 = 1; /* assume so */
210  nels = 1;
211  for(i=0;i<rank;i++) {
212  size_t dimlen;
213  mystart[i] = (start == NULL ? 0 : start[i]);
214 #if 0
215  dimlen = (i == 0 && isrecvar ? numrecs : varshape[i]);
216  if(i == 0 && isrecvar) {/*do nothing*/}
217 #else
218  /* illegal value checks */
219  dimlen = varshape[i];
220  if(is_recdim[i]) {/*do nothing*/}
221 #endif
222  else {
223  /* mystart is unsigned, will never be < 0 */
224 #ifdef RELAX_COORD_BOUND
225  if (mystart[i] > dimlen) return NC_EINVALCOORDS;
226 #else
227  if (mystart[i] >= dimlen) return NC_EINVALCOORDS;
228 #endif
229  }
230  if(edges == NULL) {
231 #if 0
232  if(i == 0 && isrecvar)
233  myedges[i] = numrecs - start[i];
234 #else
235  if(is_recdim[i] && isrecvar)
236  myedges[i] = varshape[i] - start[i];
237 #endif
238  else
239  myedges[i] = varshape[i] - mystart[i];
240  } else
241  myedges[i] = edges[i];
242 #ifdef RELAX_COORD_BOUND
243  if(!is_recdim[i]) {
244  if (mystart[i] == dimlen && myedges[i] > 0)
245  return NC_EINVALCOORDS;
246  }
247 #endif
248  if(!is_recdim[i]) {
249  /* myediges is unsigned, will never be < 0 */
250  if(mystart[i] + myedges[i] > dimlen)
251  return NC_EEDGE;
252  }
253  mystride[i] = (stride == NULL ? 1 : stride[i]);
254  if(mystride[i] <= 0
255  /* cast needed for braindead systems with signed size_t */
256  || ((unsigned long) mystride[i] >= X_INT_MAX))
257  return NC_ESTRIDE;
258  if(mystride[i] != 1) isstride1 = 0;
259  nels *= myedges[i];
260  }
261 
262  if(isstride1) {
263  return NC_put_vara(ncid, varid, mystart, myedges, value, memtype);
264  }
265 
266  if(nels == 0) {
267  /* This should be here instead of before NC_put_vara call to
268  * avoid hang in parallel write for single stride.
269  * Still issue with parallel hang if stride > 1
270  */
271  return NC_NOERR; /* cannot write anything */
272  }
273 
274  /* Initial version uses and odometer to walk the variable
275  and read each value one at a time. This can later be optimized
276  to read larger chunks at a time.
277  */
278 
279 
280  odom_init(&odom,rank,mystart,myedges,mystride);
281 
282  /* walk the odometer to extract values */
283  while(odom_more(&odom)) {
284  int localstatus = NC_NOERR;
285  /* Write a single value */
286  localstatus = NC_put_vara(ncid,varid,odom.index,nc_sizevector1,memptr,memtype);
287  /* So it turns out that when get_varm is used, all errors are
288  delayed and ERANGE will be overwritten by more serious errors.
289  */
290  if(localstatus != NC_NOERR) {
291  if(status == NC_NOERR || localstatus != NC_ERANGE)
292  status = localstatus;
293  }
294  memptr += memtypelen;
295  odom_next(&odom);
296  }
297  return status;
298 }
299 
303 int
304 NCDEFAULT_put_varm(
305  int ncid,
306  int varid,
307  const size_t * start,
308  const size_t * edges,
309  const ptrdiff_t * stride,
310  const ptrdiff_t * imapp,
311  const void *value0,
312  nc_type memtype)
313 {
314  int status = NC_NOERR;
315  nc_type vartype = NC_NAT;
316  int varndims = 0;
317  int maxidim = 0;
318  NC* ncp;
319  int memtypelen;
320  const char* value = (char*)value0;
321 
322  status = NC_check_id (ncid, &ncp);
323  if(status != NC_NOERR) return status;
324 
325 /*
326  if(NC_indef(ncp)) return NC_EINDEFINE;
327  if(NC_readonly (ncp)) return NC_EPERM;
328 */
329 
330  /* mid body */
331  status = nc_inq_vartype(ncid, varid, &vartype);
332  if(status != NC_NOERR) return status;
333  /* Check that this is an atomic type */
334  if(vartype > NC_MAX_ATOMIC_TYPE)
335  return NC_EMAPTYPE;
336 
337  status = nc_inq_varndims(ncid, varid, &varndims);
338  if(status != NC_NOERR) return status;
339 
340  if(memtype == NC_NAT) {
341  memtype = vartype;
342  }
343 
344  if(memtype == NC_CHAR && vartype != NC_CHAR)
345  return NC_ECHAR;
346  else if(memtype != NC_CHAR && vartype == NC_CHAR)
347  return NC_ECHAR;
348 
349  memtypelen = nctypelen(memtype);
350 
351  maxidim = (int) varndims - 1;
352 
353  if (maxidim < 0)
354  {
355  /*
356  * The variable is a scalar; consequently,
357  * there s only one thing to get and only one place to put it.
358  * (Why was I called?)
359  */
360  size_t edge1[1] = {1};
361  return NC_put_vara(ncid, varid, start, edge1, value, memtype);
362  }
363 
364  /*
365  * else
366  * The variable is an array.
367  */
368  {
369  int idim;
370  size_t *mystart = NULL;
371  size_t *myedges = 0;
372  size_t *iocount= 0; /* count vector */
373  size_t *stop = 0; /* stop indexes */
374  size_t *length = 0; /* edge lengths in bytes */
375  ptrdiff_t *mystride = 0;
376  ptrdiff_t *mymap= 0;
377  size_t varshape[NC_MAX_VAR_DIMS];
378  int isrecvar;
379  size_t numrecs;
380  int stride1; /* is stride all ones? */
381 
382  /*
383  * Verify stride argument.
384  */
385  stride1 = 1; /* assume ok; */
386  if(stride != NULL) {
387  for (idim = 0; idim <= maxidim; ++idim) {
388  if ((stride[idim] == 0)
389  /* cast needed for braindead systems with signed size_t */
390  || ((unsigned long) stride[idim] >= X_INT_MAX))
391  {
392  return NC_ESTRIDE;
393  }
394  if(stride[idim] != 1) stride1 = 0;
395  }
396  }
397 
398  /* If stride1 is true, and there is no imap, then call get_vara
399  directly
400  */
401  if(stride1 && imapp == NULL) {
402  return NC_put_vara(ncid, varid, start, edges, value, memtype);
403  }
404 
405  /* Compute some dimension related values */
406  isrecvar = NC_is_recvar(ncid,varid,&numrecs);
407  NC_getshape(ncid,varid,varndims,varshape);
408 
409  /* assert(sizeof(ptrdiff_t) >= sizeof(size_t)); */
410  mystart = (size_t *)calloc((size_t)(varndims * 7), sizeof(ptrdiff_t));
411  if(mystart == NULL) return NC_ENOMEM;
412  myedges = mystart + varndims;
413  iocount = myedges + varndims;
414  stop = iocount + varndims;
415  length = stop + varndims;
416  mystride = (ptrdiff_t *)(length + varndims);
417  mymap = mystride + varndims;
418 
419  /*
420  * Check start, edges
421  */
422  for (idim = maxidim; idim >= 0; --idim)
423  {
424  mystart[idim] = start != NULL
425  ? start[idim]
426  : 0;
427 
428  myedges[idim] = edges != NULL
429  ? edges[idim]
430  : idim == 0 && isrecvar
431  ? numrecs - mystart[idim]
432  : varshape[idim] - mystart[idim];
433  }
434 
435  for (idim = isrecvar; idim <= maxidim; ++idim)
436  {
437 #ifdef RELAX_COORD_BOUND
438  if (mystart[idim] > varshape[idim] ||
439  (mystart[idim] == varshape[idim] && myedges[idim] > 0))
440 #else
441  if (mystart[idim] >= varshape[idim])
442 #endif
443  {
444  status = NC_EINVALCOORDS;
445  goto done;
446  }
447 
448  if (mystart[idim] + myedges[idim] > varshape[idim])
449  {
450  status = NC_EEDGE;
451  goto done;
452  }
453  }
454 
455  /*
456  * Initialize I/O parameters.
457  */
458  for (idim = maxidim; idim >= 0; --idim)
459  {
460  if (edges != NULL && edges[idim] == 0)
461  {
462  status = NC_NOERR; /* read/write no data */
463  goto done;
464  }
465 
466  mystride[idim] = stride != NULL
467  ? stride[idim]
468  : 1;
469  mymap[idim] = imapp != NULL
470  ? imapp[idim]
471  : idim == maxidim
472  ? 1
473  : mymap[idim + 1] * (ptrdiff_t) myedges[idim + 1];
474 
475  iocount[idim] = 1;
476  length[idim] = ((size_t)mymap[idim]) * myedges[idim];
477  stop[idim] = mystart[idim] + myedges[idim] * (size_t)mystride[idim];
478  }
479 
480  /* Lower body */
481  /*
482  * As an optimization, adjust I/O parameters when the fastest
483  * dimension has unity stride both externally and internally.
484  * In this case, the user could have called a simpler routine
485  * (i.e. ncvar$1()
486  */
487  if (mystride[maxidim] == 1
488  && mymap[maxidim] == 1)
489  {
490  iocount[maxidim] = myedges[maxidim];
491  mystride[maxidim] = (ptrdiff_t) myedges[maxidim];
492  mymap[maxidim] = (ptrdiff_t) length[maxidim];
493  }
494 
495  /*
496  * Perform I/O. Exit when done.
497  */
498  for (;;)
499  {
500  /* TODO: */
501  int lstatus = NC_put_vara(ncid, varid, mystart, iocount,
502  value, memtype);
503  if (lstatus != NC_NOERR) {
504  if(status == NC_NOERR || lstatus != NC_ERANGE)
505  status = lstatus;
506  }
507 
508  /*
509  * The following code permutes through the variable s
510  * external start-index space and it s internal address
511  * space. At the UPC, this algorithm is commonly
512  * called "odometer code".
513  */
514  idim = maxidim;
515  carry:
516  value += (mymap[idim] * memtypelen);
517  mystart[idim] += (size_t)mystride[idim];
518  if (mystart[idim] == stop[idim])
519  {
520  size_t l = (length[idim] * (size_t)memtypelen);
521  value -= l;
522  mystart[idim] = start[idim];
523  if (--idim < 0)
524  break; /* normal return */
525  goto carry;
526  }
527  } /* I/O loop */
528  done:
529  free(mystart);
530  } /* variable is array */
531  return status;
532 }
533 
537 static int
538 NC_put_vars(int ncid, int varid, const size_t *start,
539  const size_t *edges, const ptrdiff_t *stride,
540  const void *value, nc_type memtype)
541 {
542  NC* ncp;
543  size_t *my_count = (size_t *)edges;
544  ptrdiff_t *my_stride = (ptrdiff_t *)stride;
545  int stat;
546 
547  stat = NC_check_id(ncid, &ncp);
548  if(stat != NC_NOERR) return stat;
549 
550  /* Handle any NULL parameters. */
551  if(start == NULL || edges == NULL || stride == NULL) {
552  stat = NC_check_nulls(ncid, varid, start, &my_count, &my_stride);
553  if(stat != NC_NOERR) return stat;
554  }
555 
556  stat = ncp->dispatch->put_vars(ncid, varid, start, my_count, my_stride,
557  value, memtype);
558  if(edges == NULL) free(my_count);
559  if(stride == NULL) free(my_stride);
560  return stat;
561 }
562 
566 static int
567 NC_put_varm(int ncid, int varid, const size_t *start,
568  const size_t *edges, const ptrdiff_t *stride, const ptrdiff_t* map,
569  const void *value, nc_type memtype)
570 {
571  NC* ncp;
572  size_t *my_count = (size_t *)edges;
573  ptrdiff_t *my_stride = (ptrdiff_t *)stride;
574  int stat;
575 
576  stat = NC_check_id(ncid, &ncp);
577  if(stat != NC_NOERR) return stat;
578 
579  /* Handle any NULL parameters. */
580  if(start == NULL || edges == NULL || stride == NULL) {
581  stat = NC_check_nulls(ncid, varid, start, &my_count, &my_stride);
582  if(stat != NC_NOERR) return stat;
583  }
584 
585  stat = ncp->dispatch->put_varm(ncid, varid, start, my_count, my_stride,
586  map, value, memtype);
587  if(edges == NULL) free(my_count);
588  if(stride == NULL) free(my_stride);
589  return stat;
590 }
591  /* All these functions are part of this named group... */
596 
638 int
639 nc_put_vara(int ncid, int varid, const size_t *startp,
640  const size_t *countp, const void *op)
641 {
642  NC* ncp;
643  int stat = NC_check_id(ncid, &ncp);
644  nc_type xtype;
645  if(stat != NC_NOERR) return stat;
646  stat = nc_inq_vartype(ncid, varid, &xtype);
647  if(stat != NC_NOERR) return stat;
648  return NC_put_vara(ncid, varid, startp, countp, op, xtype);
649 }
650 
651 int
652 nc_put_vara_text(int ncid, int varid, const size_t *startp,
653  const size_t *countp, const char *op)
654 {
655  return NC_put_vara(ncid, varid, startp, countp,
656  (void*)op, NC_CHAR);
657 }
658 
659 int
660 nc_put_vara_schar(int ncid, int varid, const size_t *startp,
661  const size_t *countp, const signed char *op)
662 {
663  return NC_put_vara(ncid, varid, startp, countp, (void *)op,
664  NC_BYTE);
665 }
666 
667 int
668 nc_put_vara_uchar(int ncid, int varid, const size_t *startp,
669  const size_t *countp, const unsigned char *op)
670 {
671  return NC_put_vara(ncid, varid, startp, countp, (void *)op,
672  T_uchar);
673 }
674 
675 int
676 nc_put_vara_short(int ncid, int varid, const size_t *startp,
677  const size_t *countp, const short *op)
678 {
679  return NC_put_vara(ncid, varid, startp, countp, (void *)op,
680  NC_SHORT);
681 }
682 
683 int
684 nc_put_vara_int(int ncid, int varid, const size_t *startp,
685  const size_t *countp, const int *op)
686 {
687  return NC_put_vara(ncid, varid, startp, countp, (void *)op,
688  NC_INT);
689 }
690 
691 int
692 nc_put_vara_long(int ncid, int varid, const size_t *startp,
693  const size_t *countp, const long *op)
694 {
695  return NC_put_vara(ncid, varid, startp, countp, (void *)op,
696  T_long);
697 }
698 
699 int
700 nc_put_vara_float(int ncid, int varid, const size_t *startp,
701  const size_t *countp, const float *op)
702 {
703  return NC_put_vara(ncid, varid, startp, countp, (void *)op,
704  T_float);
705 }
706 
707 int
708 nc_put_vara_double(int ncid, int varid, const size_t *startp,
709  const size_t *countp, const double *op)
710 {
711  return NC_put_vara(ncid, varid, startp, countp, (void *)op,
712  T_double);
713 }
714 
715 int
716 nc_put_vara_ubyte(int ncid, int varid, const size_t *startp,
717  const size_t *countp, const unsigned char *op)
718 {
719  return NC_put_vara(ncid, varid, startp, countp, (void *)op,
720  T_ubyte);
721 }
722 
723 int
724 nc_put_vara_ushort(int ncid, int varid, const size_t *startp,
725  const size_t *countp, const unsigned short *op)
726 {
727  return NC_put_vara(ncid, varid, startp, countp, (void *)op,
728  T_ushort);
729 }
730 
731 int
732 nc_put_vara_uint(int ncid, int varid, const size_t *startp,
733  const size_t *countp, const unsigned int *op)
734 {
735  return NC_put_vara(ncid, varid, startp, countp, (void *)op,
736  T_uint);
737 }
738 
739 int
740 nc_put_vara_longlong(int ncid, int varid, const size_t *startp,
741  const size_t *countp, const long long *op)
742 {
743  return NC_put_vara(ncid, varid, startp, countp, (void *)op,
744  T_longlong);
745 }
746 
747 int
748 nc_put_vara_ulonglong(int ncid, int varid, const size_t *startp,
749  const size_t *countp, const unsigned long long *op)
750 {
751  return NC_put_vara(ncid, varid, startp, countp, (void *)op,
752  NC_UINT64);
753 }
754 
755 #ifdef USE_NETCDF4
756 int
757 nc_put_vara_string(int ncid, int varid, const size_t *startp,
758  const size_t *countp, const char* *op)
759 {
760  return NC_put_vara(ncid, varid, startp, countp, (void *)op,
761  NC_STRING);
762 }
763 
764 #endif /*USE_NETCDF4*/
765 
790 int
791 nc_put_var1(int ncid, int varid, const size_t *indexp, const void *op)
792 {
793  return NC_put_var1(ncid, varid, indexp, op, NC_NAT);
794 }
795 
796 int
797 nc_put_var1_text(int ncid, int varid, const size_t *indexp, const char *op)
798 {
799  return NC_put_var1(ncid, varid, indexp, (void *)op, NC_CHAR);
800 }
801 
802 int
803 nc_put_var1_schar(int ncid, int varid, const size_t *indexp, const signed char *op)
804 {
805  return NC_put_var1(ncid, varid, indexp, (void *)op, NC_BYTE);
806 }
807 
808 int
809 nc_put_var1_uchar(int ncid, int varid, const size_t *indexp, const unsigned char *op)
810 {
811  return NC_put_var1(ncid, varid, indexp, (void *)op, NC_UBYTE);
812 }
813 
814 int
815 nc_put_var1_short(int ncid, int varid, const size_t *indexp, const short *op)
816 {
817  return NC_put_var1(ncid, varid, indexp, (void *)op, NC_SHORT);
818 }
819 
820 int
821 nc_put_var1_int(int ncid, int varid, const size_t *indexp, const int *op)
822 {
823  return NC_put_var1(ncid, varid, indexp, (void *)op, NC_INT);
824 }
825 
826 int
827 nc_put_var1_long(int ncid, int varid, const size_t *indexp, const long *op)
828 {
829  return NC_put_var1(ncid, varid, indexp, (void*)op, longtype);
830 }
831 
832 int
833 nc_put_var1_float(int ncid, int varid, const size_t *indexp, const float *op)
834 {
835  return NC_put_var1(ncid, varid, indexp, (void*)op, NC_FLOAT);
836 }
837 
838 int
839 nc_put_var1_double(int ncid, int varid, const size_t *indexp, const double *op)
840 {
841  return NC_put_var1(ncid, varid, indexp, (void *)op, NC_DOUBLE);
842 }
843 
844 int
845 nc_put_var1_ubyte(int ncid, int varid, const size_t *indexp, const unsigned char *op)
846 {
847  return NC_put_var1(ncid, varid, indexp, (void *)op, NC_UBYTE);
848 }
849 
850 int
851 nc_put_var1_ushort(int ncid, int varid, const size_t *indexp, const unsigned short *op)
852 {
853  return NC_put_var1(ncid, varid, indexp, (void *)op, NC_USHORT);
854 }
855 
856 int
857 nc_put_var1_uint(int ncid, int varid, const size_t *indexp, const unsigned int *op)
858 {
859  return NC_put_var1(ncid, varid, indexp, (void *)op, NC_UINT);
860 }
861 
862 int
863 nc_put_var1_longlong(int ncid, int varid, const size_t *indexp, const long long *op)
864 {
865  return NC_put_var1(ncid, varid, indexp, (void *)op, NC_INT64);
866 }
867 
868 int
869 nc_put_var1_ulonglong(int ncid, int varid, const size_t *indexp, const unsigned long long *op)
870 {
871  return NC_put_var1(ncid, varid, indexp, (void *)op, NC_UINT64);
872 }
873 
874 #ifdef USE_NETCDF4
875 int
876 nc_put_var1_string(int ncid, int varid, const size_t *indexp, const char* *op)
877 {
878  return NC_put_var1(ncid, varid, indexp, (void*)op, NC_STRING);
879 }
880 #endif /*USE_NETCDF4*/
881 
930 int
931 nc_put_var(int ncid, int varid, const void *op)
932 {
933  return NC_put_var(ncid, varid, op, NC_NAT);
934 }
935 
936 int
937 nc_put_var_text(int ncid, int varid, const char *op)
938 {
939  return NC_put_var(ncid,varid,(void*)op,NC_CHAR);
940 }
941 
942 int
943 nc_put_var_schar(int ncid, int varid, const signed char *op)
944 {
945  return NC_put_var(ncid,varid,(void*)op,NC_BYTE);
946 }
947 
948 int
949 nc_put_var_uchar(int ncid, int varid, const unsigned char *op)
950 {
951  return NC_put_var(ncid,varid,(void*)op,T_uchar);
952 }
953 
954 int
955 nc_put_var_short(int ncid, int varid, const short *op)
956 {
957  return NC_put_var(ncid,varid,(void*)op,NC_SHORT);
958 }
959 
960 int
961 nc_put_var_int(int ncid, int varid, const int *op)
962 {
963  return NC_put_var(ncid,varid,(void*)op,NC_INT);
964 }
965 
966 int
967 nc_put_var_long(int ncid, int varid, const long *op)
968 {
969  return NC_put_var(ncid,varid,(void*)op,T_long);
970 }
971 
972 int
973 nc_put_var_float(int ncid, int varid, const float *op)
974 {
975  return NC_put_var(ncid,varid,(void*)op,T_float);
976 }
977 
978 int
979 nc_put_var_double(int ncid, int varid, const double *op)
980 {
981  return NC_put_var(ncid,varid,(void*)op,T_double);
982 }
983 
984 int
985 nc_put_var_ubyte(int ncid, int varid, const unsigned char *op)
986 {
987  return NC_put_var(ncid,varid,(void*)op,T_ubyte);
988 }
989 
990 int
991 nc_put_var_ushort(int ncid, int varid, const unsigned short *op)
992 {
993  return NC_put_var(ncid,varid,(void*)op,T_ushort);
994 }
995 
996 int
997 nc_put_var_uint(int ncid, int varid, const unsigned int *op)
998 {
999  return NC_put_var(ncid,varid,(void*)op,T_uint);
1000 }
1001 
1002 int
1003 nc_put_var_longlong(int ncid, int varid, const long long *op)
1004 {
1005  return NC_put_var(ncid,varid,(void*)op,T_longlong);
1006 }
1007 
1008 int
1009 nc_put_var_ulonglong(int ncid, int varid, const unsigned long long *op)
1010 {
1011  return NC_put_var(ncid,varid,(void*)op,NC_UINT64);
1012 }
1013 
1014 #ifdef USE_NETCDF4
1015 int
1016 nc_put_var_string(int ncid, int varid, const char* *op)
1017 {
1018  return NC_put_var(ncid,varid,(void*)op,NC_STRING);
1019 }
1020 #endif /*USE_NETCDF4*/
1021 
1054 int
1055 nc_put_vars(int ncid, int varid, const size_t *startp,
1056  const size_t *countp, const ptrdiff_t *stridep,
1057  const void *op)
1058 {
1059  return NC_put_vars(ncid, varid, startp, countp, stridep, op, NC_NAT);
1060 }
1061 
1062 int
1063 nc_put_vars_text(int ncid, int varid, const size_t *startp,
1064  const size_t *countp, const ptrdiff_t *stridep,
1065  const char *op)
1066 {
1067  return NC_put_vars(ncid, varid, startp, countp,
1068  stridep,(void*)op,NC_CHAR);
1069 }
1070 
1071 int
1072 nc_put_vars_schar(int ncid, int varid, const size_t *startp,
1073  const size_t *countp, const ptrdiff_t *stridep,
1074  const signed char *op)
1075 {
1076  return NC_put_vars(ncid, varid, startp, countp,
1077  stridep,(void*)op,NC_BYTE);
1078 }
1079 
1080 int
1081 nc_put_vars_uchar(int ncid, int varid,
1082  const size_t *startp, const size_t *countp,
1083  const ptrdiff_t *stridep,
1084  const unsigned char *op)
1085 {
1086  return NC_put_vars(ncid, varid, startp, countp,
1087  stridep, (void *)op, T_uchar);
1088 }
1089 
1090 int
1091 nc_put_vars_short(int ncid, int varid,
1092  const size_t *startp, const size_t *countp,
1093  const ptrdiff_t *stridep,
1094  const short *op)
1095 {
1096  return NC_put_vars(ncid, varid, startp, countp,
1097  stridep, (void *)op, NC_SHORT);
1098 }
1099 
1100 int
1101 nc_put_vars_int(int ncid, int varid,
1102  const size_t *startp, const size_t *countp,
1103  const ptrdiff_t *stridep,
1104  const int *op)
1105 {
1106  return NC_put_vars(ncid, varid, startp, countp,
1107  stridep, (void *)op, NC_INT);
1108 }
1109 
1110 int
1111 nc_put_vars_long(int ncid, int varid,
1112  const size_t *startp, const size_t *countp,
1113  const ptrdiff_t *stridep,
1114  const long *op)
1115 {
1116  return NC_put_vars(ncid, varid, startp, countp,
1117  stridep, (void *)op, T_long);
1118 }
1119 
1120 int
1121 nc_put_vars_float(int ncid, int varid,
1122  const size_t *startp, const size_t *countp,
1123  const ptrdiff_t *stridep,
1124  const float *op)
1125 {
1126  return NC_put_vars(ncid, varid, startp, countp,
1127  stridep, (void *)op, T_float);
1128 }
1129 
1130 int
1131 nc_put_vars_double(int ncid, int varid,
1132  const size_t *startp, const size_t *countp,
1133  const ptrdiff_t *stridep,
1134  const double *op)
1135 {
1136  return NC_put_vars(ncid, varid, startp, countp,
1137  stridep, (void *)op, T_double);
1138 }
1139 
1140 int
1141 nc_put_vars_ubyte(int ncid, int varid,
1142  const size_t *startp, const size_t *countp,
1143  const ptrdiff_t *stridep,
1144  const unsigned char *op)
1145 {
1146  return NC_put_vars(ncid, varid, startp, countp,
1147  stridep, (void *)op, T_ubyte);
1148 }
1149 
1150 int
1151 nc_put_vars_ushort(int ncid, int varid,
1152  const size_t *startp, const size_t *countp,
1153  const ptrdiff_t *stridep,
1154  const unsigned short *op)
1155 {
1156  return NC_put_vars(ncid, varid, startp, countp,
1157  stridep, (void *)op, T_ushort);
1158 }
1159 
1160 int
1161 nc_put_vars_uint(int ncid, int varid,
1162  const size_t *startp, const size_t *countp,
1163  const ptrdiff_t *stridep,
1164  const unsigned int *op)
1165 {
1166  return NC_put_vars(ncid, varid, startp, countp,
1167  stridep, (void *)op, T_uint);
1168 }
1169 
1170 int
1171 nc_put_vars_longlong(int ncid, int varid,
1172  const size_t *startp, const size_t *countp,
1173  const ptrdiff_t *stridep,
1174  const long long *op)
1175 {
1176  return NC_put_vars(ncid, varid, startp, countp,
1177  stridep, (void *)op, T_longlong);
1178 }
1179 
1180 int
1181 nc_put_vars_ulonglong(int ncid, int varid,
1182  const size_t *startp, const size_t *countp,
1183  const ptrdiff_t *stridep,
1184  const unsigned long long *op)
1185 {
1186  return NC_put_vars(ncid, varid, startp, countp,
1187  stridep, (void *)op, NC_UINT64);
1188 }
1189 
1190 #ifdef USE_NETCDF4
1191 int
1192 nc_put_vars_string(int ncid, int varid,
1193  const size_t *startp, const size_t *countp,
1194  const ptrdiff_t *stridep,
1195  const char**op)
1196 {
1197  return NC_put_vars(ncid, varid, startp, countp, stridep,
1198  (void *)op, NC_STRING);
1199 }
1200 #endif /*USE_NETCDF4*/
1201 
1247 int
1248 nc_put_varm(int ncid, int varid, const size_t *startp,
1249  const size_t *countp, const ptrdiff_t *stridep,
1250  const ptrdiff_t *imapp, const void *op)
1251 {
1252  return NC_put_varm(ncid, varid, startp, countp, stridep, imapp, op, NC_NAT);
1253 }
1254 
1255 int
1256 nc_put_varm_text(int ncid, int varid, const size_t *startp,
1257  const size_t *countp, const ptrdiff_t *stridep,
1258  const ptrdiff_t *imapp, const char *op)
1259 {
1260  return NC_put_varm(ncid, varid, startp, countp, stridep, imapp,
1261  (void *)op, NC_CHAR);
1262 }
1263 
1264 int
1265 nc_put_varm_schar(int ncid, int varid,
1266  const size_t *startp, const size_t *countp,
1267  const ptrdiff_t *stridep, const ptrdiff_t *imapp,
1268  const signed char *op)
1269 {
1270  return NC_put_varm(ncid, varid, startp, countp, stridep, imapp,
1271  (void *)op, NC_BYTE);
1272 }
1273 
1274 int
1275 nc_put_varm_uchar(int ncid, int varid,
1276  const size_t *startp, const size_t *countp,
1277  const ptrdiff_t *stridep, const ptrdiff_t *imapp,
1278  const unsigned char *op)
1279 {
1280  return NC_put_varm(ncid, varid, startp, countp, stridep, imapp,
1281  (void *)op, T_uchar);
1282 }
1283 
1284 int
1285 nc_put_varm_short(int ncid, int varid,
1286  const size_t *startp, const size_t *countp,
1287  const ptrdiff_t *stridep, const ptrdiff_t *imapp,
1288  const short *op)
1289 {
1290  return NC_put_varm(ncid, varid, startp, countp, stridep, imapp,
1291  (void *)op, NC_SHORT);
1292 }
1293 
1294 int
1295 nc_put_varm_int(int ncid, int varid,
1296  const size_t *startp, const size_t *countp,
1297  const ptrdiff_t *stridep, const ptrdiff_t *imapp,
1298  const int *op)
1299 {
1300  return NC_put_varm(ncid, varid, startp, countp, stridep, imapp,
1301  (void *)op, NC_INT);
1302 }
1303 
1304 int
1305 nc_put_varm_long(int ncid, int varid,
1306  const size_t *startp, const size_t *countp,
1307  const ptrdiff_t *stridep, const ptrdiff_t *imapp,
1308  const long *op)
1309 {
1310  return NC_put_varm(ncid, varid, startp, countp, stridep, imapp,
1311  (void *)op, T_long);
1312 }
1313 
1314 int
1315 nc_put_varm_float(int ncid, int varid,
1316  const size_t *startp, const size_t *countp,
1317  const ptrdiff_t *stridep, const ptrdiff_t *imapp,
1318  const float *op)
1319 {
1320  return NC_put_varm(ncid, varid, startp, countp, stridep, imapp,
1321  (void *)op, T_float);
1322 }
1323 
1324 int
1325 nc_put_varm_double(int ncid, int varid,
1326  const size_t *startp, const size_t *countp,
1327  const ptrdiff_t *stridep, const ptrdiff_t *imapp,
1328  const double *op)
1329 {
1330  return NC_put_varm(ncid, varid, startp, countp, stridep, imapp,
1331  (void *)op, T_double);
1332 }
1333 
1334 int
1335 nc_put_varm_ubyte(int ncid, int varid,
1336  const size_t *startp, const size_t *countp,
1337  const ptrdiff_t *stridep, const ptrdiff_t *imapp,
1338  const unsigned char *op)
1339 {
1340  return NC_put_varm(ncid, varid, startp, countp, stridep, imapp,
1341  (void *)op, T_ubyte);
1342 }
1343 
1344 int
1345 nc_put_varm_ushort(int ncid, int varid,
1346  const size_t *startp, const size_t *countp,
1347  const ptrdiff_t *stridep, const ptrdiff_t *imapp,
1348  const unsigned short *op)
1349 {
1350  return NC_put_varm(ncid, varid, startp, countp, stridep, imapp,
1351  (void *)op, T_ushort);
1352 }
1353 
1354 int
1355 nc_put_varm_uint(int ncid, int varid,
1356  const size_t *startp, const size_t *countp,
1357  const ptrdiff_t *stridep, const ptrdiff_t *imapp,
1358  const unsigned int *op)
1359 {
1360  return NC_put_varm(ncid, varid, startp, countp, stridep, imapp,
1361  (void *)op, T_uint);
1362 }
1363 
1364 int
1365 nc_put_varm_longlong(int ncid, int varid,
1366  const size_t *startp, const size_t *countp,
1367  const ptrdiff_t *stridep, const ptrdiff_t *imapp,
1368  const long long *op)
1369 {
1370  return NC_put_varm(ncid, varid, startp, countp, stridep, imapp,
1371  (void *)op, T_longlong);
1372 }
1373 
1374 int
1375 nc_put_varm_ulonglong(int ncid, int varid,
1376  const size_t *startp, const size_t *countp,
1377  const ptrdiff_t *stridep, const ptrdiff_t *imapp,
1378  const unsigned long long *op)
1379 {
1380  return NC_put_varm(ncid, varid, startp, countp, stridep, imapp,
1381  (void *)op, NC_UINT64);
1382 }
1383 
1384 #ifdef USE_NETCDF4
1385 int
1386 nc_put_varm_string(int ncid, int varid,
1387  const size_t *startp, const size_t *countp,
1388  const ptrdiff_t *stridep, const ptrdiff_t *imapp,
1389  const char**op)
1390 {
1391  return NC_put_varm(ncid, varid, startp, countp, stridep, imapp,
1392  (void *)op, NC_STRING);
1393 }
1394 #endif /*USE_NETCDF4*/
1395  /*End of named group... */
int nc_put_var_long(int ncid, int varid, const long *op)
Write an entire variable with one call.
Definition: dvarput.c:967
#define NC_ENOMEM
Memory allocation (malloc) failure.
Definition: netcdf.h:405
int nc_put_varm_ubyte(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const unsigned char *op)
Write a mapped array of values to a variable.
Definition: dvarput.c:1335
int nc_put_vars_double(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const double *op)
Write a strided array of values to a variable.
Definition: dvarput.c:1131
#define NC_CHAR
ISO/ASCII character.
Definition: netcdf.h:36
int nc_put_vars_uchar(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const unsigned char *op)
Write a strided array of values to a variable.
Definition: dvarput.c:1081
int nc_put_vara_schar(int ncid, int varid, const size_t *startp, const size_t *countp, const signed char *op)
Write an array of values to a variable.
Definition: dvarput.c:660
int nc_put_var1_string(int ncid, int varid, const size_t *indexp, const char **op)
Write one datum.
Definition: dvarput.c:876
int nc_put_vars_uint(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const unsigned int *op)
Write a strided array of values to a variable.
Definition: dvarput.c:1161
#define NC_UBYTE
unsigned 1 byte int
Definition: netcdf.h:42
#define NC_EMAPTYPE
Mapped access for atomic types only.
Definition: netcdf.h:458
#define NC_ERANGE
Math result not representable.
Definition: netcdf.h:404
#define NC_MAX_VAR_DIMS
max per variable dimensions
Definition: netcdf.h:276
int nc_put_vara_uchar(int ncid, int varid, const size_t *startp, const size_t *countp, const unsigned char *op)
Write an array of values to a variable.
Definition: dvarput.c:668
#define NC_UINT
unsigned 4-byte int
Definition: netcdf.h:44
int nc_put_var_uint(int ncid, int varid, const unsigned int *op)
Write an entire variable with one call.
Definition: dvarput.c:997
int nc_put_vars_longlong(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const long long *op)
Write a strided array of values to a variable.
Definition: dvarput.c:1171
int nc_put_vara_longlong(int ncid, int varid, const size_t *startp, const size_t *countp, const long long *op)
Write an array of values to a variable.
Definition: dvarput.c:740
int nc_put_var_ulonglong(int ncid, int varid, const unsigned long long *op)
Write an entire variable with one call.
Definition: dvarput.c:1009
int nc_put_varm_ushort(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const unsigned short *op)
Write a mapped array of values to a variable.
Definition: dvarput.c:1345
int nc_put_vars_int(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const int *op)
Write a strided array of values to a variable.
Definition: dvarput.c:1101
#define NC_EINVALCOORDS
Index exceeds dimension bound.
Definition: netcdf.h:357
int nc_put_vars_ubyte(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const unsigned char *op)
Write a strided array of values to a variable.
Definition: dvarput.c:1141
int nc_put_vars_ushort(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const unsigned short *op)
Write a strided array of values to a variable.
Definition: dvarput.c:1151
int nc_put_var_schar(int ncid, int varid, const signed char *op)
Write an entire variable with one call.
Definition: dvarput.c:943
int nc_put_vara_double(int ncid, int varid, const size_t *startp, const size_t *countp, const double *op)
Write an array of values to a variable.
Definition: dvarput.c:708
int nc_put_var_int(int ncid, int varid, const int *op)
Write an entire variable with one call.
Definition: dvarput.c:961
int nc_put_var1_uchar(int ncid, int varid, const size_t *indexp, const unsigned char *op)
Write one datum.
Definition: dvarput.c:809
int nc_put_vara_float(int ncid, int varid, const size_t *startp, const size_t *countp, const float *op)
Write an array of values to a variable.
Definition: dvarput.c:700
#define NC_INT64
signed 8-byte int
Definition: netcdf.h:45
int nc_put_var(int ncid, int varid, const void *op)
Write an entire variable with one call.
Definition: dvarput.c:931
int nc_put_var1_ushort(int ncid, int varid, const size_t *indexp, const unsigned short *op)
Write one datum.
Definition: dvarput.c:851
#define NC_STRING
string
Definition: netcdf.h:47
int nc_put_vara(int ncid, int varid, const size_t *startp, const size_t *countp, const void *op)
Write an array of values to a variable.
Definition: dvarput.c:639
#define NC_DOUBLE
double precision floating point number
Definition: netcdf.h:41
EXTERNL int nc_inq_varndims(int ncid, int varid, int *ndimsp)
Learn how many dimensions are associated with a variable.
Definition: dvarinq.c:204
int nc_put_var1_double(int ncid, int varid, const size_t *indexp, const double *op)
Write one datum.
Definition: dvarput.c:839
int nc_put_varm(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const void *op)
Write a mapped array of values to a variable.
Definition: dvarput.c:1248
int nc_put_vars_short(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const short *op)
Write a strided array of values to a variable.
Definition: dvarput.c:1091
int nc_type
The nc_type type is just an int.
Definition: netcdf.h:25
int nc_put_varm_int(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const int *op)
Write a mapped array of values to a variable.
Definition: dvarput.c:1295
int nc_put_vars(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const void *op)
Write a strided array of values to a variable.
Definition: dvarput.c:1055
int nc_put_var_string(int ncid, int varid, const char **op)
Write an entire variable with one call.
Definition: dvarput.c:1016
int nc_put_vara_short(int ncid, int varid, const size_t *startp, const size_t *countp, const short *op)
Write an array of values to a variable.
Definition: dvarput.c:676
#define NC_BYTE
signed 1 byte integer
Definition: netcdf.h:35
int nc_put_vara_uint(int ncid, int varid, const size_t *startp, const size_t *countp, const unsigned int *op)
Write an array of values to a variable.
Definition: dvarput.c:732
int nc_put_varm_short(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const short *op)
Write a mapped array of values to a variable.
Definition: dvarput.c:1285
int nc_put_var_ubyte(int ncid, int varid, const unsigned char *op)
Write an entire variable with one call.
Definition: dvarput.c:985
int nc_put_vars_float(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const float *op)
Write a strided array of values to a variable.
Definition: dvarput.c:1121
int nc_put_vara_string(int ncid, int varid, const size_t *startp, const size_t *countp, const char **op)
Write an array of values to a variable.
Definition: dvarput.c:757
int nc_put_vara_text(int ncid, int varid, const size_t *startp, const size_t *countp, const char *op)
Write an array of values to a variable.
Definition: dvarput.c:652
int nc_put_var1_float(int ncid, int varid, const size_t *indexp, const float *op)
Write one datum.
Definition: dvarput.c:833
int nc_put_var_longlong(int ncid, int varid, const long long *op)
Write an entire variable with one call.
Definition: dvarput.c:1003
int nc_put_vara_ubyte(int ncid, int varid, const size_t *startp, const size_t *countp, const unsigned char *op)
Write an array of values to a variable.
Definition: dvarput.c:716
int nc_put_varm_text(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const char *op)
Write a mapped array of values to a variable.
Definition: dvarput.c:1256
int nc_put_var1_int(int ncid, int varid, const size_t *indexp, const int *op)
Write one datum.
Definition: dvarput.c:821
int nc_put_varm_string(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const char **op)
Write a mapped array of values to a variable.
Definition: dvarput.c:1386
int nc_put_varm_ulonglong(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const unsigned long long *op)
Write a mapped array of values to a variable.
Definition: dvarput.c:1375
int nc_put_vara_ushort(int ncid, int varid, const size_t *startp, const size_t *countp, const unsigned short *op)
Write an array of values to a variable.
Definition: dvarput.c:724
#define NC_EBADTYPE
Not a netcdf data type.
Definition: netcdf.h:367
int nc_put_var1_longlong(int ncid, int varid, const size_t *indexp, const long long *op)
Write one datum.
Definition: dvarput.c:863
#define NC_EEDGE
Start+count exceeds dimension bound.
Definition: netcdf.h:395
int nc_put_vara_long(int ncid, int varid, const size_t *startp, const size_t *countp, const long *op)
Write an array of values to a variable.
Definition: dvarput.c:692
#define NC_ESTRIDE
Illegal stride.
Definition: netcdf.h:396
int nc_put_varm_longlong(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const long long *op)
Write a mapped array of values to a variable.
Definition: dvarput.c:1365
int nc_put_var1(int ncid, int varid, const size_t *indexp, const void *op)
Write one datum.
Definition: dvarput.c:791
#define NC_INT
signed 4 byte integer
Definition: netcdf.h:38
#define NC_NAT
Not A Type.
Definition: netcdf.h:34
int nc_put_var1_schar(int ncid, int varid, const size_t *indexp, const signed char *op)
Write one datum.
Definition: dvarput.c:803
EXTERNL int nc_inq_vartype(int ncid, int varid, nc_type *xtypep)
Learn the type of a variable.
Definition: dvarinq.c:180
EXTERNL int nc_inq_type(int ncid, nc_type xtype, char *name, size_t *size)
Inquire about a type.
Definition: dfile.c:1719
int nc_put_vara_int(int ncid, int varid, const size_t *startp, const size_t *countp, const int *op)
Write an array of values to a variable.
Definition: dvarput.c:684
int nc_put_varm_schar(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const signed char *op)
Write a mapped array of values to a variable.
Definition: dvarput.c:1265
#define NC_USHORT
unsigned 2-byte int
Definition: netcdf.h:43
int nc_put_var1_ulonglong(int ncid, int varid, const size_t *indexp, const unsigned long long *op)
Write one datum.
Definition: dvarput.c:869
int nc_put_varm_double(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const double *op)
Write a mapped array of values to a variable.
Definition: dvarput.c:1325
int nc_put_var1_short(int ncid, int varid, const size_t *indexp, const short *op)
Write one datum.
Definition: dvarput.c:815
int nc_put_var_double(int ncid, int varid, const double *op)
Write an entire variable with one call.
Definition: dvarput.c:979
int nc_put_varm_long(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const long *op)
Write a mapped array of values to a variable.
Definition: dvarput.c:1305
int nc_put_var_text(int ncid, int varid, const char *op)
Write an entire variable with one call.
Definition: dvarput.c:937
#define NC_SHORT
signed 2 byte integer
Definition: netcdf.h:37
int nc_put_varm_uint(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const unsigned int *op)
Write a mapped array of values to a variable.
Definition: dvarput.c:1355
int nc_put_var1_text(int ncid, int varid, const size_t *indexp, const char *op)
Write one datum.
Definition: dvarput.c:797
int nc_put_vara_ulonglong(int ncid, int varid, const size_t *startp, const size_t *countp, const unsigned long long *op)
Write an array of values to a variable.
Definition: dvarput.c:748
int nc_put_var_float(int ncid, int varid, const float *op)
Write an entire variable with one call.
Definition: dvarput.c:973
int nc_put_vars_text(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const char *op)
Write a strided array of values to a variable.
Definition: dvarput.c:1063
int nc_put_var1_long(int ncid, int varid, const size_t *indexp, const long *op)
Write one datum.
Definition: dvarput.c:827
int nc_put_var_ushort(int ncid, int varid, const unsigned short *op)
Write an entire variable with one call.
Definition: dvarput.c:991
int nc_put_vars_schar(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const signed char *op)
Write a strided array of values to a variable.
Definition: dvarput.c:1072
#define NC_NOERR
No Error.
Definition: netcdf.h:325
int nc_put_vars_long(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const long *op)
Write a strided array of values to a variable.
Definition: dvarput.c:1111
#define NC_ECHAR
Attempt to convert between text & numbers.
Definition: netcdf.h:386
int nc_put_vars_ulonglong(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const unsigned long long *op)
Write a strided array of values to a variable.
Definition: dvarput.c:1181
int nc_put_var1_uint(int ncid, int varid, const size_t *indexp, const unsigned int *op)
Write one datum.
Definition: dvarput.c:857
int nc_put_var_uchar(int ncid, int varid, const unsigned char *op)
Write an entire variable with one call.
Definition: dvarput.c:949
int nc_put_var_short(int ncid, int varid, const short *op)
Write an entire variable with one call.
Definition: dvarput.c:955
#define NC_FLOAT
single precision floating point number
Definition: netcdf.h:40
int nc_put_varm_float(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const float *op)
Write a mapped array of values to a variable.
Definition: dvarput.c:1315
int nc_put_var1_ubyte(int ncid, int varid, const size_t *indexp, const unsigned char *op)
Write one datum.
Definition: dvarput.c:845
int nc_put_varm_uchar(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const unsigned char *op)
Write a mapped array of values to a variable.
Definition: dvarput.c:1275
#define NC_UINT64
unsigned 8-byte int
Definition: netcdf.h:46
int nc_put_vars_string(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const char **op)
Write a strided array of values to a variable.
Definition: dvarput.c:1192

Return to the Main Unidata NetCDF page.
Generated on Mon Apr 29 2019 10:59:59 for NetCDF. NetCDF is a Unidata library.