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