netcdf.h
Go to the documentation of this file.
1 
11 #ifndef _NETCDF_
12 #define _NETCDF_
13 
14 #include <stddef.h> /* size_t, ptrdiff_t */
15 #include <errno.h> /* netcdf functions sometimes return system errors */
16 
17 /* Required for alloca on Windows */
18 #if defined(_WIN32) || defined(_WIN64)
19 #include <malloc.h>
20 #endif
21 
22 #ifdef _WIN64
23 #include <sys/stat.h>
24 #endif
25 
27 typedef int nc_type;
28 
29 #if defined(__cplusplus)
30 extern "C" {
31 #endif
32 
33 /*
34  * The netcdf external data types
35  */
36 #define NC_NAT 0
37 #define NC_BYTE 1
38 #define NC_CHAR 2
39 #define NC_SHORT 3
40 #define NC_INT 4
41 #define NC_LONG NC_INT
42 #define NC_FLOAT 5
43 #define NC_DOUBLE 6
44 #define NC_UBYTE 7
45 #define NC_USHORT 8
46 #define NC_UINT 9
47 #define NC_INT64 10
48 #define NC_UINT64 11
49 #define NC_STRING 12
51 #define NC_MAX_ATOMIC_TYPE NC_STRING
52 
53 /* The following are use internally in support of user-defines
54  * types. They are also the class returned by nc_inq_user_type. */
55 #define NC_VLEN 13
56 #define NC_OPAQUE 14
57 #define NC_ENUM 15
58 #define NC_COMPOUND 16
60 /* Define the first user defined type id (leave some room) */
61 #define NC_FIRSTUSERTYPEID 32
62 
68 #define NC_FILL_BYTE ((signed char)-127)
69 #define NC_FILL_CHAR ((char)0)
70 #define NC_FILL_SHORT ((short)-32767)
71 #define NC_FILL_INT (-2147483647L)
72 #define NC_FILL_FLOAT (9.9692099683868690e+36f) /* near 15 * 2^119 */
73 #define NC_FILL_DOUBLE (9.9692099683868690e+36)
74 #define NC_FILL_UBYTE (255)
75 #define NC_FILL_USHORT (65535)
76 #define NC_FILL_UINT (4294967295U)
77 #define NC_FILL_INT64 ((long long)-9223372036854775806LL)
78 #define NC_FILL_UINT64 ((unsigned long long)18446744073709551614ULL)
79 #define NC_FILL_STRING ""
80 
90 #define NC_MAX_BYTE 127
91 #define NC_MIN_BYTE (-NC_MAX_BYTE-1)
92 #define NC_MAX_CHAR 255
93 #define NC_MAX_SHORT 32767
94 #define NC_MIN_SHORT (-NC_MAX_SHORT - 1)
95 #define NC_MAX_INT 2147483647
96 #define NC_MIN_INT (-NC_MAX_INT - 1)
97 #define NC_MAX_FLOAT 3.402823466e+38f
98 #define NC_MIN_FLOAT (-NC_MAX_FLOAT)
99 #define NC_MAX_DOUBLE 1.7976931348623157e+308
100 #define NC_MIN_DOUBLE (-NC_MAX_DOUBLE)
101 #define NC_MAX_UBYTE NC_MAX_CHAR
102 #define NC_MAX_USHORT 65535U
103 #define NC_MAX_UINT 4294967295U
104 #define NC_MAX_INT64 (9223372036854775807LL)
105 #define NC_MIN_INT64 (-9223372036854775807LL-1)
106 #define NC_MAX_UINT64 (18446744073709551615ULL)
107 #define X_INT64_MAX (9223372036854775807LL)
108 #define X_INT64_MIN (-X_INT64_MAX - 1)
109 #define X_UINT64_MAX (18446744073709551615ULL)
110 
117 #define _FillValue "_FillValue"
118 #define NC_FILL 0
119 #define NC_NOFILL 0x100
121 /* Define the ioflags bits for nc_create and nc_open.
122  currently unused: 0x0010,0x0020,0x0040,0x0080
123  and the whole upper 16 bits
124 */
125 
126 #define NC_NOWRITE 0x0000
127 #define NC_WRITE 0x0001
128 /* unused: 0x0002 */
129 #define NC_CLOBBER 0x0000
130 #define NC_NOCLOBBER 0x0004
132 #define NC_DISKLESS 0x0008
133 #define NC_MMAP 0x0010
135 #define NC_CLASSIC_MODEL 0x0100
136 #define NC_64BIT_OFFSET 0x0200
142 #define NC_LOCK 0x0400
143 
146 #define NC_SHARE 0x0800
147 
148 #define NC_NETCDF4 0x1000
152 #define NC_MPIIO 0x2000
153 
155 #define NC_MPIPOSIX 0x4000
156 #define NC_PNETCDF 0x8000
165 #define NC_FORMAT_CLASSIC (1)
166 #define NC_FORMAT_64BIT (2)
167 #define NC_FORMAT_NETCDF4 (3)
168 #define NC_FORMAT_NETCDF4_CLASSIC (4)
169 
188 #define NC_FORMAT_NC3 (1)
189 #define NC_FORMAT_NC_HDF5 (2) /*cdf 4 subset of HDF5 */
190 #define NC_FORMAT_NC_HDF4 (3) /* netcdf 4 subset of HDF4 */
191 #define NC_FORMAT_PNETCDF (4)
192 #define NC_FORMAT_DAP2 (5)
193 #define NC_FORMAT_DAP4 (6)
194 #define NC_FORMAT_UNDEFINED (0)
195 
198 #define NC_SIZEHINT_DEFAULT 0
199 
201 #define NC_ALIGN_CHUNK ((size_t)(-1))
202 
204 #define NC_UNLIMITED 0L
205 
207 #define NC_GLOBAL -1
208 
228 #define NC_MAX_DIMS 65536 /* BSK changed from 1024 for ExodusII */
229 #define NC_MAX_ATTRS 8192
230 #define NC_MAX_VARS 524288 /* BSK changed from 8192 for ExodusII */
231 #define NC_MAX_NAME 256
232 #define NC_MAX_VAR_DIMS 1024
236 #define NC_MAX_HDF4_NAME 64
237 
241 #define NC_ENDIAN_NATIVE 0
242 #define NC_ENDIAN_LITTLE 1
243 #define NC_ENDIAN_BIG 2
244 
250 #define NC_CHUNKED 0
251 #define NC_CONTIGUOUS 1
252 
259 #define NC_NOCHECKSUM 0
260 #define NC_FLETCHER32 1
261 
268 #define NC_NOSHUFFLE 0
269 #define NC_SHUFFLE 1
270 
276 #define NC_ISSYSERR(err) ((err) > 0)
277 
278 #define NC_NOERR 0
279 #define NC2_ERR (-1)
285 #define NC_EBADID (-33)
286 #define NC_ENFILE (-34)
287 #define NC_EEXIST (-35)
288 #define NC_EINVAL (-36)
289 #define NC_EPERM (-37)
294 #define NC_ENOTINDEFINE (-38)
295 
303 #define NC_EINDEFINE (-39)
304 
310 #define NC_EINVALCOORDS (-40)
311 #define NC_EMAXDIMS (-41)
312 #define NC_ENAMEINUSE (-42)
313 #define NC_ENOTATT (-43)
314 #define NC_EMAXATTS (-44)
315 #define NC_EBADTYPE (-45)
316 #define NC_EBADDIM (-46)
317 #define NC_EUNLIMPOS (-47)
322 #define NC_EMAXVARS (-48)
323 
327 #define NC_ENOTVAR (-49)
328 #define NC_EGLOBAL (-50)
329 #define NC_ENOTNC (-51)
330 #define NC_ESTS (-52)
331 #define NC_EMAXNAME (-53)
332 #define NC_EUNLIMIT (-54)
333 #define NC_ENORECVARS (-55)
334 #define NC_ECHAR (-56)
343 #define NC_EEDGE (-57)
344 #define NC_ESTRIDE (-58)
345 #define NC_EBADNAME (-59)
346 /* N.B. following must match value in ncx.h */
347 
352 #define NC_ERANGE (-60)
353 #define NC_ENOMEM (-61)
354 #define NC_EVARSIZE (-62)
355 #define NC_EDIMSIZE (-63)
356 #define NC_ETRUNC (-64)
357 #define NC_EAXISTYPE (-65)
359 /* Following errors are added for DAP */
360 #define NC_EDAP (-66)
361 #define NC_ECURL (-67)
362 #define NC_EIO (-68)
363 #define NC_ENODATA (-69)
364 #define NC_EDAPSVC (-70)
365 #define NC_EDAS (-71)
366 #define NC_EDDS (-72)
367 #define NC_EDATADDS (-73)
368 #define NC_EDAPURL (-74)
369 #define NC_EDAPCONSTRAINT (-75)
370 #define NC_ETRANSLATION (-76)
372 /* The following was added in support of netcdf-4. Make all netcdf-4
373  error codes < -100 so that errors can be added to netcdf-3 if
374  needed. */
375 #define NC4_FIRST_ERROR (-100)
376 
378 #define NC_EHDFERR (-101)
379 #define NC_ECANTREAD (-102)
380 #define NC_ECANTWRITE (-103)
381 #define NC_ECANTCREATE (-104)
382 #define NC_EFILEMETA (-105)
383 #define NC_EDIMMETA (-106)
384 #define NC_EATTMETA (-107)
385 #define NC_EVARMETA (-108)
386 #define NC_ENOCOMPOUND (-109)
387 #define NC_EATTEXISTS (-110)
388 #define NC_ENOTNC4 (-111)
391 #define NC_ESTRICTNC3 (-112)
392 #define NC_ENOTNC3 (-113)
393 #define NC_ENOPAR (-114)
394 #define NC_EPARINIT (-115)
395 #define NC_EBADGRPID (-116)
396 #define NC_EBADTYPID (-117)
397 #define NC_ETYPDEFINED (-118)
398 #define NC_EBADFIELD (-119)
399 #define NC_EBADCLASS (-120)
400 #define NC_EMAPTYPE (-121)
401 #define NC_ELATEFILL (-122)
402 #define NC_ELATEDEF (-123)
403 #define NC_EDIMSCALE (-124)
404 #define NC_ENOGRP (-125)
405 #define NC_ESTORAGE (-126)
406 #define NC_EBADCHUNK (-127)
407 #define NC_ENOTBUILT (-128)
408 #define NC_EDISKLESS (-129)
409 #define NC_ECANTEXTEND (-130)
410 #define NC_EMPI (-131)
412 #define NC4_LAST_ERROR (-131)
413 
414 /* This is used in netCDF-4 files for dimensions without coordinate
415  * vars. */
416 #define DIM_WITHOUT_VARIABLE "This is a netCDF dimension but not a netCDF variable."
417 
418 /* This is here at the request of the NCO team to support our
419  * mistake of having chunksizes be first ints, then size_t. Doh! */
420 #define NC_HAVE_NEW_CHUNKING_API 1
421 
422 
423 /*Errors for all remote access methods(e.g. DAP and CDMREMOTE)*/
424 #define NC_EURL (NC_EDAPURL) /* Malformed URL */
425 #define NC_ECONSTRAINT (NC_EDAPCONSTRAINT) /* Malformed Constraint*/
426 
427 
428 /*
429  * The Interface
430  */
431 
432 /* Declaration modifiers for DLL support (MSC et al) */
433 #if defined(DLL_NETCDF) /* define when library is a DLL */
434 # if defined(DLL_EXPORT) /* define when building the library */
435 # define MSC_EXTRA __declspec(dllexport)
436 # else
437 # define MSC_EXTRA __declspec(dllimport)
438 # endif
439 #include <io.h>
440 #else
441 #define MSC_EXTRA
442 #endif /* defined(DLL_NETCDF) */
443 
444 # define EXTERNL MSC_EXTRA extern
445 
446 #if defined(DLL_NETCDF) /* define when library is a DLL */
447 EXTERNL int ncerr;
448 EXTERNL int ncopts;
449 #endif
450 
451 EXTERNL const char *
452 nc_inq_libvers(void);
453 
454 EXTERNL const char *
455 nc_strerror(int ncerr);
456 
457 EXTERNL int
458 nc__create(const char *path, int cmode, size_t initialsz,
459  size_t *chunksizehintp, int *ncidp);
460 
461 EXTERNL int
462 nc_create(const char *path, int cmode, int *ncidp);
463 
464 EXTERNL int
465 nc__open(const char *path, int mode,
466  size_t *chunksizehintp, int *ncidp);
467 
468 EXTERNL int
469 nc_open(const char *path, int mode, int *ncidp);
470 
471 /* Learn the path used to open/create the file. */
472 EXTERNL int
473 nc_inq_path(int ncid, size_t *pathlen, char *path);
474 
475 /* Given an ncid and group name (NULL gets root group), return
476  * locid. */
477 EXTERNL int
478 nc_inq_ncid(int ncid, const char *name, int *grp_ncid);
479 
480 /* Given a location id, return the number of groups it contains, and
481  * an array of their locids. */
482 EXTERNL int
483 nc_inq_grps(int ncid, int *numgrps, int *ncids);
484 
485 /* Given locid, find name of group. (Root group is named "/".) */
486 EXTERNL int
487 nc_inq_grpname(int ncid, char *name);
488 
489 /* Given ncid, find full name and len of full name. (Root group is
490  * named "/", with length 1.) */
491 EXTERNL int
492 nc_inq_grpname_full(int ncid, size_t *lenp, char *full_name);
493 
494 /* Given ncid, find len of full name. */
495 EXTERNL int
496 nc_inq_grpname_len(int ncid, size_t *lenp);
497 
498 /* Given an ncid, find the ncid of its parent group. */
499 EXTERNL int
500 nc_inq_grp_parent(int ncid, int *parent_ncid);
501 
502 /* Given a name and parent ncid, find group ncid. */
503 EXTERNL int
504 nc_inq_grp_ncid(int ncid, const char *grp_name, int *grp_ncid);
505 
506 /* Given a full name and ncid, find group ncid. */
507 EXTERNL int
508 nc_inq_grp_full_ncid(int ncid, const char *full_name, int *grp_ncid);
509 
510 /* Get a list of ids for all the variables in a group. */
511 EXTERNL int
512 nc_inq_varids(int ncid, int *nvars, int *varids);
513 
514 /* Find all dimids for a location. This finds all dimensions in a
515  * group, or any of its parents. */
516 EXTERNL int
517 nc_inq_dimids(int ncid, int *ndims, int *dimids, int include_parents);
518 
519 /* Find all user-defined types for a location. This finds all
520  * user-defined types in a group. */
521 EXTERNL int
522 nc_inq_typeids(int ncid, int *ntypes, int *typeids);
523 
524 /* Are two types equal? */
525 EXTERNL int
526 nc_inq_type_equal(int ncid1, nc_type typeid1, int ncid2,
527  nc_type typeid2, int *equal);
528 
529 /* Create a group. its ncid is returned in the new_ncid pointer. */
530 EXTERNL int
531 nc_def_grp(int parent_ncid, const char *name, int *new_ncid);
532 
533 /* Rename a group */
534 EXTERNL int
535 nc_rename_grp(int grpid, const char *name);
536 
537 /* Here are functions for dealing with compound types. */
538 
539 /* Create a compound type. */
540 EXTERNL int
541 nc_def_compound(int ncid, size_t size, const char *name, nc_type *typeidp);
542 
543 /* Insert a named field into a compound type. */
544 EXTERNL int
545 nc_insert_compound(int ncid, nc_type xtype, const char *name,
546  size_t offset, nc_type field_typeid);
547 
548 /* Insert a named array into a compound type. */
549 EXTERNL int
550 nc_insert_array_compound(int ncid, nc_type xtype, const char *name,
551  size_t offset, nc_type field_typeid,
552  int ndims, const int *dim_sizes);
553 
554 /* Get the name and size of a type. */
555 EXTERNL int
556 nc_inq_type(int ncid, nc_type xtype, char *name, size_t *size);
557 
558 /* Get the id of a type from the name. */
559 EXTERNL int
560 nc_inq_typeid(int ncid, const char *name, nc_type *typeidp);
561 
562 /* Get the name, size, and number of fields in a compound type. */
563 EXTERNL int
564 nc_inq_compound(int ncid, nc_type xtype, char *name, size_t *sizep,
565  size_t *nfieldsp);
566 
567 /* Get the name of a compound type. */
568 EXTERNL int
569 nc_inq_compound_name(int ncid, nc_type xtype, char *name);
570 
571 /* Get the size of a compound type. */
572 EXTERNL int
573 nc_inq_compound_size(int ncid, nc_type xtype, size_t *sizep);
574 
575 /* Get the number of fields in this compound type. */
576 EXTERNL int
577 nc_inq_compound_nfields(int ncid, nc_type xtype, size_t *nfieldsp);
578 
579 /* Given the xtype and the fieldid, get all info about it. */
580 EXTERNL int
581 nc_inq_compound_field(int ncid, nc_type xtype, int fieldid, char *name,
582  size_t *offsetp, nc_type *field_typeidp, int *ndimsp,
583  int *dim_sizesp);
584 
585 /* Given the typeid and the fieldid, get the name. */
586 EXTERNL int
587 nc_inq_compound_fieldname(int ncid, nc_type xtype, int fieldid,
588  char *name);
589 
590 /* Given the xtype and the name, get the fieldid. */
591 EXTERNL int
592 nc_inq_compound_fieldindex(int ncid, nc_type xtype, const char *name,
593  int *fieldidp);
594 
595 /* Given the xtype and fieldid, get the offset. */
596 EXTERNL int
597 nc_inq_compound_fieldoffset(int ncid, nc_type xtype, int fieldid,
598  size_t *offsetp);
599 
600 /* Given the xtype and the fieldid, get the type of that field. */
601 EXTERNL int
602 nc_inq_compound_fieldtype(int ncid, nc_type xtype, int fieldid,
603  nc_type *field_typeidp);
604 
605 /* Given the xtype and the fieldid, get the number of dimensions for
606  * that field (scalars are 0). */
607 EXTERNL int
608 nc_inq_compound_fieldndims(int ncid, nc_type xtype, int fieldid,
609  int *ndimsp);
610 
611 /* Given the xtype and the fieldid, get the sizes of dimensions for
612  * that field. User must have allocated storage for the dim_sizes. */
613 EXTERNL int
614 nc_inq_compound_fielddim_sizes(int ncid, nc_type xtype, int fieldid,
615  int *dim_sizes);
616 
618 typedef struct {
619  size_t len;
620  void *p;
621 } nc_vlen_t;
622 
627 #define NC_COMPOUND_OFFSET(S,M) (offsetof(S,M))
628 
629 /* Create a variable length type. */
630 EXTERNL int
631 nc_def_vlen(int ncid, const char *name, nc_type base_typeid, nc_type *xtypep);
632 
633 /* Find out about a vlen. */
634 EXTERNL int
635 nc_inq_vlen(int ncid, nc_type xtype, char *name, size_t *datum_sizep,
636  nc_type *base_nc_typep);
637 
638 /* When you read VLEN type the library will actually allocate the
639  * storage space for the data. This storage space must be freed, so
640  * pass the pointer back to this function, when you're done with the
641  * data, and it will free the vlen memory. */
642 EXTERNL int
644 
645 EXTERNL int
646 nc_free_vlens(size_t len, nc_vlen_t vlens[]);
647 
648 /* Put or get one element in a vlen array. */
649 EXTERNL int
650 nc_put_vlen_element(int ncid, int typeid1, void *vlen_element,
651  size_t len, const void *data);
652 
653 EXTERNL int
654 nc_get_vlen_element(int ncid, int typeid1, const void *vlen_element,
655  size_t *len, void *data);
656 
657 /* When you read the string type the library will allocate the storage
658  * space for the data. This storage space must be freed, so pass the
659  * pointer back to this function, when you're done with the data, and
660  * it will free the string memory. */
661 EXTERNL int
662 nc_free_string(size_t len, char **data);
663 
664 /* Find out about a user defined type. */
665 EXTERNL int
666 nc_inq_user_type(int ncid, nc_type xtype, char *name, size_t *size,
667  nc_type *base_nc_typep, size_t *nfieldsp, int *classp);
668 
669 /* Write an attribute of any type. */
670 EXTERNL int
671 nc_put_att(int ncid, int varid, const char *name, nc_type xtype,
672  size_t len, const void *op);
673 
674 /* Read an attribute of any type. */
675 EXTERNL int
676 nc_get_att(int ncid, int varid, const char *name, void *ip);
677 
678 /* Enum type. */
679 
680 /* Create an enum type. Provide a base type and a name. At the moment
681  * only ints are accepted as base types. */
682 EXTERNL int
683 nc_def_enum(int ncid, nc_type base_typeid, const char *name,
684  nc_type *typeidp);
685 
686 /* Insert a named value into an enum type. The value must fit within
687  * the size of the enum type, the name size must be <= NC_MAX_NAME. */
688 EXTERNL int
689 nc_insert_enum(int ncid, nc_type xtype, const char *name,
690  const void *value);
691 
692 /* Get information about an enum type: its name, base type and the
693  * number of members defined. */
694 EXTERNL int
695 nc_inq_enum(int ncid, nc_type xtype, char *name, nc_type *base_nc_typep,
696  size_t *base_sizep, size_t *num_membersp);
697 
698 /* Get information about an enum member: a name and value. Name size
699  * will be <= NC_MAX_NAME. */
700 EXTERNL int
701 nc_inq_enum_member(int ncid, nc_type xtype, int idx, char *name,
702  void *value);
703 
704 
705 /* Get enum name from enum value. Name size will be <= NC_MAX_NAME. */
706 EXTERNL int
707 nc_inq_enum_ident(int ncid, nc_type xtype, long long value, char *identifier);
708 
709 /* Opaque type. */
710 
711 /* Create an opaque type. Provide a size and a name. */
712 EXTERNL int
713 nc_def_opaque(int ncid, size_t size, const char *name, nc_type *xtypep);
714 
715 /* Get information about an opaque type. */
716 EXTERNL int
717 nc_inq_opaque(int ncid, nc_type xtype, char *name, size_t *sizep);
718 
719 /* Write entire var of any type. */
720 EXTERNL int
721 nc_put_var(int ncid, int varid, const void *op);
722 
723 /* Read entire var of any type. */
724 EXTERNL int
725 nc_get_var(int ncid, int varid, void *ip);
726 
727 /* Write one value. */
728 EXTERNL int
729 nc_put_var1(int ncid, int varid, const size_t *indexp,
730  const void *op);
731 
732 /* Read one value. */
733 EXTERNL int
734 nc_get_var1(int ncid, int varid, const size_t *indexp, void *ip);
735 
736 /* Write an array of values. */
737 EXTERNL int
738 nc_put_vara(int ncid, int varid, const size_t *startp,
739  const size_t *countp, const void *op);
740 
741 /* Read an array of values. */
742 EXTERNL int
743 nc_get_vara(int ncid, int varid, const size_t *startp,
744  const size_t *countp, void *ip);
745 
746 /* Write slices of an array of values. */
747 EXTERNL int
748 nc_put_vars(int ncid, int varid, const size_t *startp,
749  const size_t *countp, const ptrdiff_t *stridep,
750  const void *op);
751 
752 /* Read slices of an array of values. */
753 EXTERNL int
754 nc_get_vars(int ncid, int varid, const size_t *startp,
755  const size_t *countp, const ptrdiff_t *stridep,
756  void *ip);
757 
758 /* Write mapped slices of an array of values. */
759 EXTERNL int
760 nc_put_varm(int ncid, int varid, const size_t *startp,
761  const size_t *countp, const ptrdiff_t *stridep,
762  const ptrdiff_t *imapp, const void *op);
763 
764 /* Read mapped slices of an array of values. */
765 EXTERNL int
766 nc_get_varm(int ncid, int varid, const size_t *startp,
767  const size_t *countp, const ptrdiff_t *stridep,
768  const ptrdiff_t *imapp, void *ip);
769 
770 /* Extra netcdf-4 stuff. */
771 
772 /* Set compression settings for a variable. Lower is faster, higher is
773  * better. Must be called after nc_def_var and before nc_enddef. */
774 EXTERNL int
775 nc_def_var_deflate(int ncid, int varid, int shuffle, int deflate,
776  int deflate_level);
777 
778 /* Find out compression settings of a var. */
779 EXTERNL int
780 nc_inq_var_deflate(int ncid, int varid, int *shufflep,
781  int *deflatep, int *deflate_levelp);
782 
783 /* Find out szip settings of a var. */
784 EXTERNL int
785 nc_inq_var_szip(int ncid, int varid, int *options_maskp, int *pixels_per_blockp);
786 
787 /* Set fletcher32 checksum for a var. This must be done after nc_def_var
788  and before nc_enddef. */
789 EXTERNL int
790 nc_def_var_fletcher32(int ncid, int varid, int fletcher32);
791 
792 /* Inquire about fletcher32 checksum for a var. */
793 EXTERNL int
794 nc_inq_var_fletcher32(int ncid, int varid, int *fletcher32p);
795 
796 /* Define chunking for a variable. This must be done after nc_def_var
797  and before nc_enddef. */
798 EXTERNL int
799 nc_def_var_chunking(int ncid, int varid, int storage, const size_t *chunksizesp);
800 
801 /* Inq chunking stuff for a var. */
802 EXTERNL int
803 nc_inq_var_chunking(int ncid, int varid, int *storagep, size_t *chunksizesp);
804 
805 /* Define fill value behavior for a variable. This must be done after
806  nc_def_var and before nc_enddef. */
807 EXTERNL int
808 nc_def_var_fill(int ncid, int varid, int no_fill, const void *fill_value);
809 
810 /* Inq fill value setting for a var. */
811 EXTERNL int
812 nc_inq_var_fill(int ncid, int varid, int *no_fill, void *fill_valuep);
813 
814 /* Define the endianness of a variable. */
815 EXTERNL int
816 nc_def_var_endian(int ncid, int varid, int endian);
817 
818 /* Learn about the endianness of a variable. */
819 EXTERNL int
820 nc_inq_var_endian(int ncid, int varid, int *endianp);
821 
822 /* Set the fill mode (classic or 64-bit offset files only). */
823 EXTERNL int
824 nc_set_fill(int ncid, int fillmode, int *old_modep);
825 
826 /* Set the default nc_create format to NC_FORMAT_CLASSIC,
827  * NC_FORMAT_64BIT, NC_FORMAT_NETCDF4, NC_FORMAT_NETCDF4_CLASSIC. */
828 EXTERNL int
829 nc_set_default_format(int format, int *old_formatp);
830 
831 /* Set the cache size, nelems, and preemption policy. */
832 EXTERNL int
833 nc_set_chunk_cache(size_t size, size_t nelems, float preemption);
834 
835 /* Get the cache size, nelems, and preemption policy. */
836 EXTERNL int
837 nc_get_chunk_cache(size_t *sizep, size_t *nelemsp, float *preemptionp);
838 
839 /* Set the per-variable cache size, nelems, and preemption policy. */
840 EXTERNL int
841 nc_set_var_chunk_cache(int ncid, int varid, size_t size, size_t nelems,
842  float preemption);
843 
844 /* Set the per-variable cache size, nelems, and preemption policy. */
845 EXTERNL int
846 nc_get_var_chunk_cache(int ncid, int varid, size_t *sizep, size_t *nelemsp,
847  float *preemptionp);
848 
849 EXTERNL int
850 nc_redef(int ncid);
851 
852 /* Is this ever used? */
853 EXTERNL int
854 nc__enddef(int ncid, size_t h_minfree, size_t v_align,
855  size_t v_minfree, size_t r_align);
856 
857 EXTERNL int
858 nc_enddef(int ncid);
859 
860 EXTERNL int
861 nc_sync(int ncid);
862 
863 EXTERNL int
864 nc_abort(int ncid);
865 
866 EXTERNL int
867 nc_close(int ncid);
868 
869 EXTERNL int
870 nc_inq(int ncid, int *ndimsp, int *nvarsp, int *nattsp, int *unlimdimidp);
871 
872 EXTERNL int
873 nc_inq_ndims(int ncid, int *ndimsp);
874 
875 EXTERNL int
876 nc_inq_nvars(int ncid, int *nvarsp);
877 
878 EXTERNL int
879 nc_inq_natts(int ncid, int *nattsp);
880 
881 EXTERNL int
882 nc_inq_unlimdim(int ncid, int *unlimdimidp);
883 
884 /* The next function is for NetCDF-4 only */
885 EXTERNL int
886 nc_inq_unlimdims(int ncid, int *nunlimdimsp, int *unlimdimidsp);
887 
888 /* Added in 3.6.1 to return format of netCDF file. */
889 EXTERNL int
890 nc_inq_format(int ncid, int *formatp);
891 
892 /* Added in 4.3.1 to return additional format info */
893 EXTERNL int
894 nc_inq_format_extended(int ncid, int *formatp, int* modep);
895 
896 /* Begin _dim */
897 
898 EXTERNL int
899 nc_def_dim(int ncid, const char *name, size_t len, int *idp);
900 
901 EXTERNL int
902 nc_inq_dimid(int ncid, const char *name, int *idp);
903 
904 EXTERNL int
905 nc_inq_dim(int ncid, int dimid, char *name, size_t *lenp);
906 
907 EXTERNL int
908 nc_inq_dimname(int ncid, int dimid, char *name);
909 
910 EXTERNL int
911 nc_inq_dimlen(int ncid, int dimid, size_t *lenp);
912 
913 EXTERNL int
914 nc_rename_dim(int ncid, int dimid, const char *name);
915 
916 /* End _dim */
917 /* Begin _att */
918 
919 EXTERNL int
920 nc_inq_att(int ncid, int varid, const char *name,
921  nc_type *xtypep, size_t *lenp);
922 
923 EXTERNL int
924 nc_inq_attid(int ncid, int varid, const char *name, int *idp);
925 
926 EXTERNL int
927 nc_inq_atttype(int ncid, int varid, const char *name, nc_type *xtypep);
928 
929 EXTERNL int
930 nc_inq_attlen(int ncid, int varid, const char *name, size_t *lenp);
931 
932 EXTERNL int
933 nc_inq_attname(int ncid, int varid, int attnum, char *name);
934 
935 EXTERNL int
936 nc_copy_att(int ncid_in, int varid_in, const char *name, int ncid_out, int varid_out);
937 
938 EXTERNL int
939 nc_rename_att(int ncid, int varid, const char *name, const char *newname);
940 
941 EXTERNL int
942 nc_del_att(int ncid, int varid, const char *name);
943 
944 /* End _att */
945 /* Begin {put,get}_att */
946 
947 EXTERNL int
948 nc_put_att_text(int ncid, int varid, const char *name,
949  size_t len, const char *op);
950 
951 EXTERNL int
952 nc_get_att_text(int ncid, int varid, const char *name, char *ip);
953 
954 EXTERNL int
955 nc_put_att_uchar(int ncid, int varid, const char *name, nc_type xtype,
956  size_t len, const unsigned char *op);
957 
958 EXTERNL int
959 nc_get_att_uchar(int ncid, int varid, const char *name, unsigned char *ip);
960 
961 EXTERNL int
962 nc_put_att_schar(int ncid, int varid, const char *name, nc_type xtype,
963  size_t len, const signed char *op);
964 
965 EXTERNL int
966 nc_get_att_schar(int ncid, int varid, const char *name, signed char *ip);
967 
968 EXTERNL int
969 nc_put_att_short(int ncid, int varid, const char *name, nc_type xtype,
970  size_t len, const short *op);
971 
972 EXTERNL int
973 nc_get_att_short(int ncid, int varid, const char *name, short *ip);
974 
975 EXTERNL int
976 nc_put_att_int(int ncid, int varid, const char *name, nc_type xtype,
977  size_t len, const int *op);
978 
979 EXTERNL int
980 nc_get_att_int(int ncid, int varid, const char *name, int *ip);
981 
982 EXTERNL int
983 nc_put_att_long(int ncid, int varid, const char *name, nc_type xtype,
984  size_t len, const long *op);
985 
986 EXTERNL int
987 nc_get_att_long(int ncid, int varid, const char *name, long *ip);
988 
989 EXTERNL int
990 nc_put_att_float(int ncid, int varid, const char *name, nc_type xtype,
991  size_t len, const float *op);
992 
993 EXTERNL int
994 nc_get_att_float(int ncid, int varid, const char *name, float *ip);
995 
996 EXTERNL int
997 nc_put_att_double(int ncid, int varid, const char *name, nc_type xtype,
998  size_t len, const double *op);
999 
1000 EXTERNL int
1001 nc_get_att_double(int ncid, int varid, const char *name, double *ip);
1002 
1003 EXTERNL int
1004 nc_put_att_ushort(int ncid, int varid, const char *name, nc_type xtype,
1005  size_t len, const unsigned short *op);
1006 
1007 EXTERNL int
1008 nc_get_att_ushort(int ncid, int varid, const char *name, unsigned short *ip);
1009 
1010 EXTERNL int
1011 nc_put_att_uint(int ncid, int varid, const char *name, nc_type xtype,
1012  size_t len, const unsigned int *op);
1013 
1014 EXTERNL int
1015 nc_get_att_uint(int ncid, int varid, const char *name, unsigned int *ip);
1016 
1017 EXTERNL int
1018 nc_put_att_longlong(int ncid, int varid, const char *name, nc_type xtype,
1019  size_t len, const long long *op);
1020 
1021 EXTERNL int
1022 nc_get_att_longlong(int ncid, int varid, const char *name, long long *ip);
1023 
1024 EXTERNL int
1025 nc_put_att_ulonglong(int ncid, int varid, const char *name, nc_type xtype,
1026  size_t len, const unsigned long long *op);
1027 
1028 EXTERNL int
1029 nc_get_att_ulonglong(int ncid, int varid, const char *name,
1030  unsigned long long *ip);
1031 
1032 EXTERNL int
1033 nc_put_att_string(int ncid, int varid, const char *name,
1034  size_t len, const char **op);
1035 
1036 EXTERNL int
1037 nc_get_att_string(int ncid, int varid, const char *name, char **ip);
1038 
1039 /* End {put,get}_att */
1040 /* Begin _var */
1041 
1042 EXTERNL int
1043 nc_def_var(int ncid, const char *name, nc_type xtype, int ndims,
1044  const int *dimidsp, int *varidp);
1045 
1046 EXTERNL int
1047 nc_inq_var(int ncid, int varid, char *name, nc_type *xtypep,
1048  int *ndimsp, int *dimidsp, int *nattsp);
1049 
1050 EXTERNL int
1051 nc_inq_varid(int ncid, const char *name, int *varidp);
1052 
1053 EXTERNL int
1054 nc_inq_varname(int ncid, int varid, char *name);
1055 
1056 EXTERNL int
1057 nc_inq_vartype(int ncid, int varid, nc_type *xtypep);
1058 
1059 EXTERNL int
1060 nc_inq_varndims(int ncid, int varid, int *ndimsp);
1061 
1062 EXTERNL int
1063 nc_inq_vardimid(int ncid, int varid, int *dimidsp);
1064 
1065 EXTERNL int
1066 nc_inq_varnatts(int ncid, int varid, int *nattsp);
1067 
1068 EXTERNL int
1069 nc_rename_var(int ncid, int varid, const char *name);
1070 
1071 EXTERNL int
1072 nc_copy_var(int ncid_in, int varid, int ncid_out);
1073 
1074 #ifndef ncvarcpy
1075 /* support the old name for now */
1076 #define ncvarcpy(ncid_in, varid, ncid_out) ncvarcopy((ncid_in), (varid), (ncid_out))
1077 #endif
1078 
1079 /* End _var */
1080 /* Begin {put,get}_var1 */
1081 
1082 EXTERNL int
1083 nc_put_var1_text(int ncid, int varid, const size_t *indexp, const char *op);
1084 
1085 EXTERNL int
1086 nc_get_var1_text(int ncid, int varid, const size_t *indexp, char *ip);
1087 
1088 EXTERNL int
1089 nc_put_var1_uchar(int ncid, int varid, const size_t *indexp,
1090  const unsigned char *op);
1091 
1092 EXTERNL int
1093 nc_get_var1_uchar(int ncid, int varid, const size_t *indexp,
1094  unsigned char *ip);
1095 
1096 EXTERNL int
1097 nc_put_var1_schar(int ncid, int varid, const size_t *indexp,
1098  const signed char *op);
1099 
1100 EXTERNL int
1101 nc_get_var1_schar(int ncid, int varid, const size_t *indexp,
1102  signed char *ip);
1103 
1104 EXTERNL int
1105 nc_put_var1_short(int ncid, int varid, const size_t *indexp,
1106  const short *op);
1107 
1108 EXTERNL int
1109 nc_get_var1_short(int ncid, int varid, const size_t *indexp,
1110  short *ip);
1111 
1112 EXTERNL int
1113 nc_put_var1_int(int ncid, int varid, const size_t *indexp, const int *op);
1114 
1115 EXTERNL int
1116 nc_get_var1_int(int ncid, int varid, const size_t *indexp, int *ip);
1117 
1118 EXTERNL int
1119 nc_put_var1_long(int ncid, int varid, const size_t *indexp, const long *op);
1120 
1121 EXTERNL int
1122 nc_get_var1_long(int ncid, int varid, const size_t *indexp, long *ip);
1123 
1124 EXTERNL int
1125 nc_put_var1_float(int ncid, int varid, const size_t *indexp, const float *op);
1126 
1127 EXTERNL int
1128 nc_get_var1_float(int ncid, int varid, const size_t *indexp, float *ip);
1129 
1130 EXTERNL int
1131 nc_put_var1_double(int ncid, int varid, const size_t *indexp, const double *op);
1132 
1133 EXTERNL int
1134 nc_get_var1_double(int ncid, int varid, const size_t *indexp, double *ip);
1135 
1136 EXTERNL int
1137 nc_put_var1_ushort(int ncid, int varid, const size_t *indexp,
1138  const unsigned short *op);
1139 
1140 EXTERNL int
1141 nc_get_var1_ushort(int ncid, int varid, const size_t *indexp,
1142  unsigned short *ip);
1143 
1144 EXTERNL int
1145 nc_put_var1_uint(int ncid, int varid, const size_t *indexp,
1146  const unsigned int *op);
1147 
1148 EXTERNL int
1149 nc_get_var1_uint(int ncid, int varid, const size_t *indexp,
1150  unsigned int *ip);
1151 
1152 EXTERNL int
1153 nc_put_var1_longlong(int ncid, int varid, const size_t *indexp,
1154  const long long *op);
1155 
1156 EXTERNL int
1157 nc_get_var1_longlong(int ncid, int varid, const size_t *indexp,
1158  long long *ip);
1159 
1160 EXTERNL int
1161 nc_put_var1_ulonglong(int ncid, int varid, const size_t *indexp,
1162  const unsigned long long *op);
1163 
1164 EXTERNL int
1165 nc_get_var1_ulonglong(int ncid, int varid, const size_t *indexp,
1166  unsigned long long *ip);
1167 
1168 EXTERNL int
1169 nc_put_var1_string(int ncid, int varid, const size_t *indexp,
1170  const char **op);
1171 
1172 EXTERNL int
1173 nc_get_var1_string(int ncid, int varid, const size_t *indexp,
1174  char **ip);
1175 
1176 /* End {put,get}_var1 */
1177 /* Begin {put,get}_vara */
1178 
1179 EXTERNL int
1180 nc_put_vara_text(int ncid, int varid, const size_t *startp,
1181  const size_t *countp, const char *op);
1182 
1183 EXTERNL int
1184 nc_get_vara_text(int ncid, int varid, const size_t *startp,
1185  const size_t *countp, char *ip);
1186 
1187 EXTERNL int
1188 nc_put_vara_uchar(int ncid, int varid, const size_t *startp,
1189  const size_t *countp, const unsigned char *op);
1190 
1191 EXTERNL int
1192 nc_get_vara_uchar(int ncid, int varid, const size_t *startp,
1193  const size_t *countp, unsigned char *ip);
1194 
1195 EXTERNL int
1196 nc_put_vara_schar(int ncid, int varid, const size_t *startp,
1197  const size_t *countp, const signed char *op);
1198 
1199 EXTERNL int
1200 nc_get_vara_schar(int ncid, int varid, const size_t *startp,
1201  const size_t *countp, signed char *ip);
1202 
1203 EXTERNL int
1204 nc_put_vara_short(int ncid, int varid, const size_t *startp,
1205  const size_t *countp, const short *op);
1206 
1207 EXTERNL int
1208 nc_get_vara_short(int ncid, int varid, const size_t *startp,
1209  const size_t *countp, short *ip);
1210 
1211 EXTERNL int
1212 nc_put_vara_int(int ncid, int varid, const size_t *startp,
1213  const size_t *countp, const int *op);
1214 
1215 EXTERNL int
1216 nc_get_vara_int(int ncid, int varid, const size_t *startp,
1217  const size_t *countp, int *ip);
1218 
1219 EXTERNL int
1220 nc_put_vara_long(int ncid, int varid, const size_t *startp,
1221  const size_t *countp, const long *op);
1222 
1223 EXTERNL int
1224 nc_get_vara_long(int ncid, int varid,
1225  const size_t *startp, const size_t *countp, long *ip);
1226 
1227 EXTERNL int
1228 nc_put_vara_float(int ncid, int varid,
1229  const size_t *startp, const size_t *countp, const float *op);
1230 
1231 EXTERNL int
1232 nc_get_vara_float(int ncid, int varid,
1233  const size_t *startp, const size_t *countp, float *ip);
1234 
1235 EXTERNL int
1236 nc_put_vara_double(int ncid, int varid, const size_t *startp,
1237  const size_t *countp, const double *op);
1238 
1239 EXTERNL int
1240 nc_get_vara_double(int ncid, int varid, const size_t *startp,
1241  const size_t *countp, double *ip);
1242 
1243 EXTERNL int
1244 nc_put_vara_ushort(int ncid, int varid, const size_t *startp,
1245  const size_t *countp, const unsigned short *op);
1246 
1247 EXTERNL int
1248 nc_get_vara_ushort(int ncid, int varid, const size_t *startp,
1249  const size_t *countp, unsigned short *ip);
1250 
1251 EXTERNL int
1252 nc_put_vara_uint(int ncid, int varid, const size_t *startp,
1253  const size_t *countp, const unsigned int *op);
1254 
1255 EXTERNL int
1256 nc_get_vara_uint(int ncid, int varid, const size_t *startp,
1257  const size_t *countp, unsigned int *ip);
1258 
1259 EXTERNL int
1260 nc_put_vara_longlong(int ncid, int varid, const size_t *startp,
1261  const size_t *countp, const long long *op);
1262 
1263 EXTERNL int
1264 nc_get_vara_longlong(int ncid, int varid, const size_t *startp,
1265  const size_t *countp, long long *ip);
1266 
1267 EXTERNL int
1268 nc_put_vara_ulonglong(int ncid, int varid, const size_t *startp,
1269  const size_t *countp, const unsigned long long *op);
1270 
1271 EXTERNL int
1272 nc_get_vara_ulonglong(int ncid, int varid, const size_t *startp,
1273  const size_t *countp, unsigned long long *ip);
1274 
1275 EXTERNL int
1276 nc_put_vara_string(int ncid, int varid, const size_t *startp,
1277  const size_t *countp, const char **op);
1278 
1279 EXTERNL int
1280 nc_get_vara_string(int ncid, int varid, const size_t *startp,
1281  const size_t *countp, char **ip);
1282 
1283 /* End {put,get}_vara */
1284 /* Begin {put,get}_vars */
1285 
1286 EXTERNL int
1287 nc_put_vars_text(int ncid, int varid,
1288  const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
1289  const char *op);
1290 
1291 EXTERNL int
1292 nc_get_vars_text(int ncid, int varid,
1293  const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
1294  char *ip);
1295 
1296 EXTERNL int
1297 nc_put_vars_uchar(int ncid, int varid,
1298  const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
1299  const unsigned char *op);
1300 
1301 EXTERNL int
1302 nc_get_vars_uchar(int ncid, int varid,
1303  const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
1304  unsigned char *ip);
1305 
1306 EXTERNL int
1307 nc_put_vars_schar(int ncid, int varid,
1308  const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
1309  const signed char *op);
1310 
1311 EXTERNL int
1312 nc_get_vars_schar(int ncid, int varid,
1313  const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
1314  signed char *ip);
1315 
1316 EXTERNL int
1317 nc_put_vars_short(int ncid, int varid,
1318  const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
1319  const short *op);
1320 
1321 EXTERNL int
1322 nc_get_vars_short(int ncid, int varid, const size_t *startp,
1323  const size_t *countp, const ptrdiff_t *stridep,
1324  short *ip);
1325 
1326 EXTERNL int
1327 nc_put_vars_int(int ncid, int varid,
1328  const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
1329  const int *op);
1330 
1331 EXTERNL int
1332 nc_get_vars_int(int ncid, int varid,
1333  const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
1334  int *ip);
1335 
1336 EXTERNL int
1337 nc_put_vars_long(int ncid, int varid,
1338  const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
1339  const long *op);
1340 
1341 EXTERNL int
1342 nc_get_vars_long(int ncid, int varid,
1343  const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
1344  long *ip);
1345 
1346 EXTERNL int
1347 nc_put_vars_float(int ncid, int varid,
1348  const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
1349  const float *op);
1350 
1351 EXTERNL int
1352 nc_get_vars_float(int ncid, int varid,
1353  const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
1354  float *ip);
1355 
1356 EXTERNL int
1357 nc_put_vars_double(int ncid, int varid,
1358  const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
1359  const double *op);
1360 
1361 EXTERNL int
1362 nc_get_vars_double(int ncid, int varid, const size_t *startp,
1363  const size_t *countp, const ptrdiff_t *stridep,
1364  double *ip);
1365 
1366 EXTERNL int
1367 nc_put_vars_ushort(int ncid, int varid, const size_t *startp,
1368  const size_t *countp, const ptrdiff_t *stridep,
1369  const unsigned short *op);
1370 
1371 EXTERNL int
1372 nc_get_vars_ushort(int ncid, int varid, const size_t *startp,
1373  const size_t *countp, const ptrdiff_t *stridep,
1374  unsigned short *ip);
1375 
1376 EXTERNL int
1377 nc_put_vars_uint(int ncid, int varid, const size_t *startp,
1378  const size_t *countp, const ptrdiff_t *stridep,
1379  const unsigned int *op);
1380 
1381 EXTERNL int
1382 nc_get_vars_uint(int ncid, int varid, const size_t *startp,
1383  const size_t *countp, const ptrdiff_t *stridep,
1384  unsigned int *ip);
1385 
1386 EXTERNL int
1387 nc_put_vars_longlong(int ncid, int varid, const size_t *startp,
1388  const size_t *countp, const ptrdiff_t *stridep,
1389  const long long *op);
1390 
1391 EXTERNL int
1392 nc_get_vars_longlong(int ncid, int varid, const size_t *startp,
1393  const size_t *countp, const ptrdiff_t *stridep,
1394  long long *ip);
1395 
1396 EXTERNL int
1397 nc_put_vars_ulonglong(int ncid, int varid, const size_t *startp,
1398  const size_t *countp, const ptrdiff_t *stridep,
1399  const unsigned long long *op);
1400 
1401 EXTERNL int
1402 nc_get_vars_ulonglong(int ncid, int varid, const size_t *startp,
1403  const size_t *countp, const ptrdiff_t *stridep,
1404  unsigned long long *ip);
1405 
1406 EXTERNL int
1407 nc_put_vars_string(int ncid, int varid, const size_t *startp,
1408  const size_t *countp, const ptrdiff_t *stridep,
1409  const char **op);
1410 
1411 EXTERNL int
1412 nc_get_vars_string(int ncid, int varid, const size_t *startp,
1413  const size_t *countp, const ptrdiff_t *stridep,
1414  char **ip);
1415 
1416 /* End {put,get}_vars */
1417 /* Begin {put,get}_varm */
1418 
1419 EXTERNL int
1420 nc_put_varm_text(int ncid, int varid, const size_t *startp,
1421  const size_t *countp, const ptrdiff_t *stridep,
1422  const ptrdiff_t *imapp, const char *op);
1423 
1424 EXTERNL int
1425 nc_get_varm_text(int ncid, int varid, const size_t *startp,
1426  const size_t *countp, const ptrdiff_t *stridep,
1427  const ptrdiff_t *imapp, char *ip);
1428 
1429 EXTERNL int
1430 nc_put_varm_uchar(int ncid, int varid, const size_t *startp,
1431  const size_t *countp, const ptrdiff_t *stridep,
1432  const ptrdiff_t *imapp, const unsigned char *op);
1433 
1434 EXTERNL int
1435 nc_get_varm_uchar(int ncid, int varid, const size_t *startp,
1436  const size_t *countp, const ptrdiff_t *stridep,
1437  const ptrdiff_t *imapp, unsigned char *ip);
1438 
1439 EXTERNL int
1440 nc_put_varm_schar(int ncid, int varid, const size_t *startp,
1441  const size_t *countp, const ptrdiff_t *stridep,
1442  const ptrdiff_t *imapp, const signed char *op);
1443 
1444 EXTERNL int
1445 nc_get_varm_schar(int ncid, int varid, const size_t *startp,
1446  const size_t *countp, const ptrdiff_t *stridep,
1447  const ptrdiff_t *imapp, signed char *ip);
1448 
1449 EXTERNL int
1450 nc_put_varm_short(int ncid, int varid, const size_t *startp,
1451  const size_t *countp, const ptrdiff_t *stridep,
1452  const ptrdiff_t *imapp, const short *op);
1453 
1454 EXTERNL int
1455 nc_get_varm_short(int ncid, int varid, const size_t *startp,
1456  const size_t *countp, const ptrdiff_t *stridep,
1457  const ptrdiff_t *imapp, short *ip);
1458 
1459 EXTERNL int
1460 nc_put_varm_int(int ncid, int varid, const size_t *startp,
1461  const size_t *countp, const ptrdiff_t *stridep,
1462  const ptrdiff_t *imapp, const int *op);
1463 
1464 EXTERNL int
1465 nc_get_varm_int(int ncid, int varid, const size_t *startp,
1466  const size_t *countp, const ptrdiff_t *stridep,
1467  const ptrdiff_t *imapp, int *ip);
1468 
1469 EXTERNL int
1470 nc_put_varm_long(int ncid, int varid, const size_t *startp,
1471  const size_t *countp, const ptrdiff_t *stridep,
1472  const ptrdiff_t *imapp, const long *op);
1473 
1474 EXTERNL int
1475 nc_get_varm_long(int ncid, int varid, const size_t *startp,
1476  const size_t *countp, const ptrdiff_t *stridep,
1477  const ptrdiff_t *imapp, long *ip);
1478 
1479 EXTERNL int
1480 nc_put_varm_float(int ncid, int varid,const size_t *startp,
1481  const size_t *countp, const ptrdiff_t *stridep,
1482  const ptrdiff_t *imapp, const float *op);
1483 
1484 EXTERNL int
1485 nc_get_varm_float(int ncid, int varid,const size_t *startp,
1486  const size_t *countp, const ptrdiff_t *stridep,
1487  const ptrdiff_t *imapp, float *ip);
1488 
1489 EXTERNL int
1490 nc_put_varm_double(int ncid, int varid, const size_t *startp,
1491  const size_t *countp, const ptrdiff_t *stridep,
1492  const ptrdiff_t *imapp, const double *op);
1493 
1494 EXTERNL int
1495 nc_get_varm_double(int ncid, int varid, const size_t *startp,
1496  const size_t *countp, const ptrdiff_t *stridep,
1497  const ptrdiff_t * imapp, double *ip);
1498 
1499 EXTERNL int
1500 nc_put_varm_ushort(int ncid, int varid, const size_t *startp,
1501  const size_t *countp, const ptrdiff_t *stridep,
1502  const ptrdiff_t * imapp, const unsigned short *op);
1503 
1504 EXTERNL int
1505 nc_get_varm_ushort(int ncid, int varid, const size_t *startp,
1506  const size_t *countp, const ptrdiff_t *stridep,
1507  const ptrdiff_t * imapp, unsigned short *ip);
1508 
1509 EXTERNL int
1510 nc_put_varm_uint(int ncid, int varid, const size_t *startp,
1511  const size_t *countp, const ptrdiff_t *stridep,
1512  const ptrdiff_t * imapp, const unsigned int *op);
1513 
1514 EXTERNL int
1515 nc_get_varm_uint(int ncid, int varid, const size_t *startp,
1516  const size_t *countp, const ptrdiff_t *stridep,
1517  const ptrdiff_t * imapp, unsigned int *ip);
1518 
1519 EXTERNL int
1520 nc_put_varm_longlong(int ncid, int varid, const size_t *startp,
1521  const size_t *countp, const ptrdiff_t *stridep,
1522  const ptrdiff_t * imapp, const long long *op);
1523 
1524 EXTERNL int
1525 nc_get_varm_longlong(int ncid, int varid, const size_t *startp,
1526  const size_t *countp, const ptrdiff_t *stridep,
1527  const ptrdiff_t * imapp, long long *ip);
1528 
1529 EXTERNL int
1530 nc_put_varm_ulonglong(int ncid, int varid, const size_t *startp,
1531  const size_t *countp, const ptrdiff_t *stridep,
1532  const ptrdiff_t * imapp, const unsigned long long *op);
1533 
1534 EXTERNL int
1535 nc_get_varm_ulonglong(int ncid, int varid, const size_t *startp,
1536  const size_t *countp, const ptrdiff_t *stridep,
1537  const ptrdiff_t * imapp, unsigned long long *ip);
1538 
1539 EXTERNL int
1540 nc_put_varm_string(int ncid, int varid, const size_t *startp,
1541  const size_t *countp, const ptrdiff_t *stridep,
1542  const ptrdiff_t * imapp, const char **op);
1543 
1544 EXTERNL int
1545 nc_get_varm_string(int ncid, int varid, const size_t *startp,
1546  const size_t *countp, const ptrdiff_t *stridep,
1547  const ptrdiff_t * imapp, char **ip);
1548 
1549 /* End {put,get}_varm */
1550 /* Begin {put,get}_var */
1551 
1552 EXTERNL int
1553 nc_put_var_text(int ncid, int varid, const char *op);
1554 
1555 EXTERNL int
1556 nc_get_var_text(int ncid, int varid, char *ip);
1557 
1558 EXTERNL int
1559 nc_put_var_uchar(int ncid, int varid, const unsigned char *op);
1560 
1561 EXTERNL int
1562 nc_get_var_uchar(int ncid, int varid, unsigned char *ip);
1563 
1564 EXTERNL int
1565 nc_put_var_schar(int ncid, int varid, const signed char *op);
1566 
1567 EXTERNL int
1568 nc_get_var_schar(int ncid, int varid, signed char *ip);
1569 
1570 EXTERNL int
1571 nc_put_var_short(int ncid, int varid, const short *op);
1572 
1573 EXTERNL int
1574 nc_get_var_short(int ncid, int varid, short *ip);
1575 
1576 EXTERNL int
1577 nc_put_var_int(int ncid, int varid, const int *op);
1578 
1579 EXTERNL int
1580 nc_get_var_int(int ncid, int varid, int *ip);
1581 
1582 EXTERNL int
1583 nc_put_var_long(int ncid, int varid, const long *op);
1584 
1585 EXTERNL int
1586 nc_get_var_long(int ncid, int varid, long *ip);
1587 
1588 EXTERNL int
1589 nc_put_var_float(int ncid, int varid, const float *op);
1590 
1591 EXTERNL int
1592 nc_get_var_float(int ncid, int varid, float *ip);
1593 
1594 EXTERNL int
1595 nc_put_var_double(int ncid, int varid, const double *op);
1596 
1597 EXTERNL int
1598 nc_get_var_double(int ncid, int varid, double *ip);
1599 
1600 EXTERNL int
1601 nc_put_var_ushort(int ncid, int varid, const unsigned short *op);
1602 
1603 EXTERNL int
1604 nc_get_var_ushort(int ncid, int varid, unsigned short *ip);
1605 
1606 EXTERNL int
1607 nc_put_var_uint(int ncid, int varid, const unsigned int *op);
1608 
1609 EXTERNL int
1610 nc_get_var_uint(int ncid, int varid, unsigned int *ip);
1611 
1612 EXTERNL int
1613 nc_put_var_longlong(int ncid, int varid, const long long *op);
1614 
1615 EXTERNL int
1616 nc_get_var_longlong(int ncid, int varid, long long *ip);
1617 
1618 EXTERNL int
1619 nc_put_var_ulonglong(int ncid, int varid, const unsigned long long *op);
1620 
1621 EXTERNL int
1622 nc_get_var_ulonglong(int ncid, int varid, unsigned long long *ip);
1623 
1624 EXTERNL int
1625 nc_put_var_string(int ncid, int varid, const char **op);
1626 
1627 EXTERNL int
1628 nc_get_var_string(int ncid, int varid, char **ip);
1629 
1630 /* Begin Deprecated, same as functions with "_ubyte" replaced by "_uchar" */
1631 EXTERNL int
1632 nc_put_att_ubyte(int ncid, int varid, const char *name, nc_type xtype,
1633  size_t len, const unsigned char *op);
1634 EXTERNL int
1635 nc_get_att_ubyte(int ncid, int varid, const char *name,
1636  unsigned char *ip);
1637 EXTERNL int
1638 nc_put_var1_ubyte(int ncid, int varid, const size_t *indexp,
1639  const unsigned char *op);
1640 EXTERNL int
1641 nc_get_var1_ubyte(int ncid, int varid, const size_t *indexp,
1642  unsigned char *ip);
1643 EXTERNL int
1644 nc_put_vara_ubyte(int ncid, int varid, const size_t *startp,
1645  const size_t *countp, const unsigned char *op);
1646 EXTERNL int
1647 nc_get_vara_ubyte(int ncid, int varid, const size_t *startp,
1648  const size_t *countp, unsigned char *ip);
1649 EXTERNL int
1650 nc_put_vars_ubyte(int ncid, int varid, const size_t *startp,
1651  const size_t *countp, const ptrdiff_t *stridep,
1652  const unsigned char *op);
1653 EXTERNL int
1654 nc_get_vars_ubyte(int ncid, int varid, const size_t *startp,
1655  const size_t *countp, const ptrdiff_t *stridep,
1656  unsigned char *ip);
1657 EXTERNL int
1658 nc_put_varm_ubyte(int ncid, int varid, const size_t *startp,
1659  const size_t *countp, const ptrdiff_t *stridep,
1660  const ptrdiff_t * imapp, const unsigned char *op);
1661 EXTERNL int
1662 nc_get_varm_ubyte(int ncid, int varid, const size_t *startp,
1663  const size_t *countp, const ptrdiff_t *stridep,
1664  const ptrdiff_t * imapp, unsigned char *ip);
1665 EXTERNL int
1666 nc_put_var_ubyte(int ncid, int varid, const unsigned char *op);
1667 EXTERNL int
1668 nc_get_var_ubyte(int ncid, int varid, unsigned char *ip);
1669 /* End Deprecated */
1670 
1671 #ifdef LOGGING
1672 
1673 /* Set the log level. 0 shows only errors, 1 only major messages,
1674  * etc., to 5, which shows way too much information. */
1675 EXTERNL int
1676 nc_set_log_level(int new_level);
1677 
1678 /* Use this to turn off logging by calling
1679  nc_log_level(NC_TURN_OFF_LOGGING) */
1680 #define NC_TURN_OFF_LOGGING (-1)
1681 
1682 #else /* not LOGGING */
1683 
1684 #define nc_set_log_level(e)
1685 
1686 #endif /* LOGGING */
1687 
1688 /* Show the netCDF library's in-memory metadata for a file. */
1689 EXTERNL int
1690 nc_show_metadata(int ncid);
1691 
1692 /* End {put,get}_var */
1693 
1694 /* #ifdef _CRAYMPP */
1695 /*
1696  * Public interfaces to better support
1697  * CRAY multi-processor systems like T3E.
1698  * A tip of the hat to NERSC.
1699  */
1700 /*
1701  * It turns out we need to declare and define
1702  * these public interfaces on all platforms
1703  * or things get ugly working out the
1704  * FORTRAN interface. On !_CRAYMPP platforms,
1705  * these functions work as advertised, but you
1706  * can only use "processor element" 0.
1707  */
1708 
1709 EXTERNL int
1710 nc__create_mp(const char *path, int cmode, size_t initialsz, int basepe,
1711  size_t *chunksizehintp, int *ncidp);
1712 
1713 EXTERNL int
1714 nc__open_mp(const char *path, int mode, int basepe,
1715  size_t *chunksizehintp, int *ncidp);
1716 
1717 EXTERNL int
1718 nc_delete(const char *path);
1719 
1720 EXTERNL int
1721 nc_delete_mp(const char *path, int basepe);
1722 
1723 EXTERNL int
1724 nc_set_base_pe(int ncid, int pe);
1725 
1726 EXTERNL int
1727 nc_inq_base_pe(int ncid, int *pe);
1728 
1729 /* #endif _CRAYMPP */
1730 
1731 /* This v2 function is used in the nc_test program. */
1732 EXTERNL int
1733 nctypelen(nc_type datatype);
1734 
1735 /* Begin v2.4 backward compatiblity */
1736 /*
1737  * defining NO_NETCDF_2 to the preprocessor
1738  * turns off backward compatiblity declarations.
1739  */
1740 #ifndef NO_NETCDF_2
1741 
1744 #define FILL_BYTE NC_FILL_BYTE
1745 #define FILL_CHAR NC_FILL_CHAR
1746 #define FILL_SHORT NC_FILL_SHORT
1747 #define FILL_LONG NC_FILL_INT
1748 #define FILL_FLOAT NC_FILL_FLOAT
1749 #define FILL_DOUBLE NC_FILL_DOUBLE
1750 
1751 #define MAX_NC_DIMS NC_MAX_DIMS
1752 #define MAX_NC_ATTRS NC_MAX_ATTRS
1753 #define MAX_NC_VARS NC_MAX_VARS
1754 #define MAX_NC_NAME NC_MAX_NAME
1755 #define MAX_VAR_DIMS NC_MAX_VAR_DIMS
1756 
1759 /*
1760  * Global error status
1761  */
1762 EXTERNL int ncerr;
1763 
1764 #define NC_ENTOOL NC_EMAXNAME /* Backward compatibility */
1765 #define NC_EXDR (-32) /* */
1766 #define NC_SYSERR (-31)
1767 
1768 /*
1769  * Global options variable.
1770  * Used to determine behavior of error handler.
1771  */
1772 #define NC_FATAL 1
1773 #define NC_VERBOSE 2
1774 
1775 EXTERNL int ncopts; /* default is (NC_FATAL | NC_VERBOSE) */
1776 
1777 EXTERNL void
1778 nc_advise(const char *cdf_routine_name, int err, const char *fmt,...);
1779 
1780 /*
1781  * C data type corresponding to a netCDF NC_LONG argument,
1782  * a signed 32 bit object.
1783  *
1784  * This is the only thing in this file which architecture dependent.
1785  */
1786 typedef int nclong;
1787 
1788 EXTERNL int
1789 nccreate(const char* path, int cmode);
1790 
1791 EXTERNL int
1792 ncopen(const char* path, int mode);
1793 
1794 EXTERNL int
1795 ncsetfill(int ncid, int fillmode);
1796 
1797 EXTERNL int
1798 ncredef(int ncid);
1799 
1800 EXTERNL int
1801 ncendef(int ncid);
1802 
1803 EXTERNL int
1804 ncsync(int ncid);
1805 
1806 EXTERNL int
1807 ncabort(int ncid);
1808 
1809 EXTERNL int
1810 ncclose(int ncid);
1811 
1812 EXTERNL int
1813 ncinquire(int ncid, int *ndimsp, int *nvarsp, int *nattsp, int *unlimdimp);
1814 
1815 EXTERNL int
1816 ncdimdef(int ncid, const char *name, long len);
1817 
1818 EXTERNL int
1819 ncdimid(int ncid, const char *name);
1820 
1821 EXTERNL int
1822 ncdiminq(int ncid, int dimid, char *name, long *lenp);
1823 
1824 EXTERNL int
1825 ncdimrename(int ncid, int dimid, const char *name);
1826 
1827 EXTERNL int
1828 ncattput(int ncid, int varid, const char *name, nc_type xtype,
1829  int len, const void *op);
1830 
1831 EXTERNL int
1832 ncattinq(int ncid, int varid, const char *name, nc_type *xtypep, int *lenp);
1833 
1834 EXTERNL int
1835 ncattget(int ncid, int varid, const char *name, void *ip);
1836 
1837 EXTERNL int
1838 ncattcopy(int ncid_in, int varid_in, const char *name, int ncid_out,
1839  int varid_out);
1840 
1841 EXTERNL int
1842 ncattname(int ncid, int varid, int attnum, char *name);
1843 
1844 EXTERNL int
1845 ncattrename(int ncid, int varid, const char *name, const char *newname);
1846 
1847 EXTERNL int
1848 ncattdel(int ncid, int varid, const char *name);
1849 
1850 EXTERNL int
1851 ncvardef(int ncid, const char *name, nc_type xtype,
1852  int ndims, const int *dimidsp);
1853 
1854 EXTERNL int
1855 ncvarid(int ncid, const char *name);
1856 
1857 EXTERNL int
1858 ncvarinq(int ncid, int varid, char *name, nc_type *xtypep,
1859  int *ndimsp, int *dimidsp, int *nattsp);
1860 
1861 EXTERNL int
1862 ncvarput1(int ncid, int varid, const long *indexp, const void *op);
1863 
1864 EXTERNL int
1865 ncvarget1(int ncid, int varid, const long *indexp, void *ip);
1866 
1867 EXTERNL int
1868 ncvarput(int ncid, int varid, const long *startp, const long *countp,
1869  const void *op);
1870 
1871 EXTERNL int
1872 ncvarget(int ncid, int varid, const long *startp, const long *countp,
1873  void *ip);
1874 
1875 EXTERNL int
1876 ncvarputs(int ncid, int varid, const long *startp, const long *countp,
1877  const long *stridep, const void *op);
1878 
1879 EXTERNL int
1880 ncvargets(int ncid, int varid, const long *startp, const long *countp,
1881  const long *stridep, void *ip);
1882 
1883 EXTERNL int
1884 ncvarputg(int ncid, int varid, const long *startp, const long *countp,
1885  const long *stridep, const long *imapp, const void *op);
1886 
1887 EXTERNL int
1888 ncvargetg(int ncid, int varid, const long *startp, const long *countp,
1889  const long *stridep, const long *imapp, void *ip);
1890 
1891 EXTERNL int
1892 ncvarrename(int ncid, int varid, const char *name);
1893 
1894 EXTERNL int
1895 ncrecinq(int ncid, int *nrecvarsp, int *recvaridsp, long *recsizesp);
1896 
1897 EXTERNL int
1898 ncrecget(int ncid, long recnum, void **datap);
1899 
1900 EXTERNL int
1901 ncrecput(int ncid, long recnum, void *const *datap);
1902 
1903 /* End v2.4 backward compatiblity */
1904 #endif
1906 #if defined(__cplusplus)
1907 }
1908 #endif
1909 
1910 /* Temporary hack to shut up warnings */
1911 #ifndef __MINGW32_VERSION
1912 #define END_OF_MAIN()
1913 #endif
1914 
1915 
1916 /* Allow dependent software to tell if
1917  nc_rename_grp() is available, as requested
1918  by Charlie Zender. */
1919 #ifndef NC_HAVE_RENAME_GRP
1920 #define NC_HAVE_RENAME_GRP
1921 #endif
1922 
1923 /* Allow dependent software to tell if
1924  inq_format_extended() is available.
1925 
1926  This is not a scalable approach to querying
1927  the functionality of the netcdf library, but
1928  it will do for the time being. */
1929 #ifndef NC_HAVE_INQ_FORMAT_EXTENDED
1930 #define NC_HAVE_INQ_FORMAT_EXTENDED
1931 #endif
1932 
1933 
1934 #endif /* _NETCDF_ */
1935 
1936 
1937 

Site Created By: libMesh Developers
Last modified: February 07 2014 16:57:06 UTC

Hosted By:
SourceForge.net Logo