source: codes/icosagcm/branches/SATURN_DYNAMICO/NETCDF4/include/netcdf.h @ 308

Last change on this file since 308 was 308, checked in by ymipsl, 10 years ago

Add compiled NETCDF4 library for occigen

YM

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