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