MISR Toolkit  1.5.1
netcdf.h
Go to the documentation of this file.
1 /* Generated automatically from netcdf.h.in by configure. */
2 /*
3  * Copyright 1993, University Corporation for Atmospheric Research
4  *
5  * Permission to use, copy, modify, and distribute this software and its
6  * documentation for any purpose without fee is hereby granted, provided
7  * that the above copyright notice appear in all copies, that both that
8  * copyright notice and this permission notice appear in supporting
9  * documentation, and that the name of UCAR/Unidata not be used in
10  * advertising or publicity pertaining to distribution of the software
11  * without specific, written prior permission. UCAR makes no
12  * representations about the suitability of this software for any purpose.
13  * It is provided "as is" without express or implied warranty. It is
14  * provided with no support and without obligation on the part of UCAR
15  * Unidata, to assist in its use, correction, modification, or enhancement.
16  *
17  */
18 /* "$Id: netcdf-linux.h 4492 2004-11-22 18:57:50Z epourmal $" */
19 
20 #ifndef _NETCDF_
21 #define _NETCDF_
22 
23 #include "H4api_adpt.h"
24 
25 #include "hdfi.h"
26 
27 /*
28  * The definitions ncvoid, USE_ENUM, and MAX_NC_OPEN, may need to be set
29  * properly for your installation.
30  */
31 
32 /*
33  * Argument type in user functions (deprecated, backward compatibility)
34  */
35 #ifndef UD_NO_VOID
36 #define ncvoid void
37 #else
38 /* system doesn't have void type */
39 #define ncvoid char
40 #endif
41 
42 
43 /*
44  * If xdr_enum works properly on your system, you can define
45  * USE_ENUM so that nc_type is an enum.
46  * Otherwise, delete this definition so that the nc_type is
47  * an int and the valid values are #defined.
48  */
49 #ifndef __MWERKS__
50 #define USE_ENUM
51 #endif
52 
53 
54 /*
55  * The following macro is provided for backward compatibility only. If you
56  * are a new user of netCDF, then you may safely ignore it. If, however,
57  * you have an existing archive of netCDF files that use default
58  * floating-point fill values, then you should know that the definition of
59  * the default floating-point fill values changed with version 2.3 of the
60  * netCDF package. Prior to this release, the default floating-point fill
61  * values were not very portable: their correct behavior depended not only
62  * upon the particular platform, but also upon the compilation
63  * environment. This led to the definition of new, default floating-point
64  * fill values that are portable across all platforms and compilation
65  * environments. If you wish, however, to obtain the old, non-portable
66  * floating-point fill values, then the following macro should have a true
67  * value PRIOR TO BUILDING THE netCDF LIBRARY.
68  *
69  * Implementation details are contained in the section below on fill values.
70  */
71 #define NC_OLD_FILLVALUES 0
72 
73 /*
74  * Fill values
75  * These values are stuffed into newly allocated space as appropriate.
76  * The hope is that one might use these to notice that a particular datum
77  * has not been set.
78  */
79 
80 #define FILL_BYTE ((char)-127) /* Largest Negative value */
81 #define FILL_CHAR ((char)0)
82 #define FILL_SHORT ((short)-32767)
83 #define FILL_LONG ((long)-2147483647)
84 
85 #if !NC_OLD_FILLVALUES
86 
87 # define FILL_FLOAT 9.9692099683868690e+36 /* near 15 * 2^119 */
88 # define FILL_DOUBLE 9.9692099683868690e+36
89 
90 #else /* NC_OLD_FILLVALUES below */
91 
92 /*
93  * This section is provided for backward compatibility only. Using
94  * XDR infinities for floating-point fill values has caused more problems
95  * than it has solved. We encourage you to define your own data-specific
96  * fill values rather than use default ones (see `_FillValue' below).
97  * If, however, you *must* use default fill values, then you should use
98  * the above fill values rather than the ones in this section.
99  */
100 
101 /*
102  * XDR_F_INFINITY is a float value whose EXTERNAL (xdr)
103  * represention is ieee floating infinity.
104  * XDR_D_INFINITY is a double value whose EXTERNAL (xdr)
105  * represention is ieee double floating point infinity.
106  * These are used as default fill values below.
107  *
108  * This section shows three techniques for setting these:
109  * Direct assignment (vax, cray) - works for non IEEE machines
110  * Doesn't work when IEEE machines don't allow
111  * float or double constants whose values are infinity.
112  * Use of a union (preferred portable method) - should work on
113  * any ANSI compiler with IEEE floating point representations,
114  * modulo byte order and sizeof() considerations.
115  * Use of pointer puns - may work with many older compilers
116  * which don't allow intialization of unions.
117  * Often doesn't work with compilers which have strict
118  * alignment rules.
119  */
120 
121  /* Direct assignment. All cases should be mutually exclusive */
122 
123 #ifdef vax
124 #define XDR_D_INFINITY 1.7014118346046923e+38
125 #define XDR_F_INFINITY 1.70141173e+38
126 #endif /* vax */
127 
128 #ifdef cray
129 #define XDR_D_INFINITY 1.797693134862313000e+308
130 #define XDR_F_INFINITY XDR_D_INFINITY
131 #endif /* cray */
132 
133 #ifdef notdef /* you might want to try these, on an IEEE machine */
134 #define XDR_D_INFINITY 1.797693134862315900e+308
135 #define XDR_F_INFINITY 3.40282357e+38
136 #endif
137 
138 #ifdef __STDC__
139  /* Use of a union, assumes IEEE representation and 1 byte unsigned char */
140 
141 #ifndef XDR_D_INFINITY
142 #define USE_D_UNION
143  union xdr_d_union {unsigned char bb[8]; double dd;} ;
144  extern union xdr_d_union xdr_d_infs ; /* instantiated in array.c */
145 #define XDR_D_INFINITY (xdr_d_infs.dd)
146 #endif /* !XDR_D_INFINITY */
147 
148 #ifndef XDR_F_INFINITY
149 #define USE_F_UNION
150  union xdr_f_union {unsigned char bb[4]; float ff;} ;
151  extern union xdr_f_union xdr_f_infs ; /* instantiated in array.c */
152 #define XDR_F_INFINITY (xdr_f_infs.ff)
153 #endif /* !XDR_F_INFINITY */
154 
155 
156 #else /* __STDC__ */
157  /* Use of a pointer pun, assumes IEEE representation, 4 byte long */
158 
159 #ifndef XDR_D_INFINITY
160 #define USE_D_LONG_PUN
161  extern long xdr_d_infinity[] ; /* instantiated in array.c */
162 #define XDR_D_INFINITY *(double *)xdr_d_infinity
163 #endif /* !XDR_D_INFINITY */
164 
165 #ifndef XDR_F_INFINITY
166 #define USE_F_LONG_PUN
167  extern long xdr_f_infinity ; /* instantiated in array.c */
168 #define XDR_F_INFINITY *((float *)&xdr_f_infinity)
169 #endif /* !XDR_F_INFINITY */
170 
171 #endif /* __STDC__ */
172 
173 /* End of INFINITY section */
174 
175 #define FILL_FLOAT XDR_F_INFINITY /* IEEE Infinity */
176 #define FILL_DOUBLE XDR_D_INFINITY
177 
178 #endif /* NC_OLD_FILLVALUES above */
179 
180 /*
181  * masks for the struct NC flags field; passed in as 'mode' arg to
182  * nccreate and ncopen.
183  *
184  */
185 #define NC_RDWR 1 /* read/write, 0 => readonly */
186 #define NC_CREAT 2 /* in create phase, cleared by ncendef */
187 #define NC_EXCL 4 /* on create, don't destroy existing file */
188 #define NC_INDEF 8 /* in define mode, cleared by ncendef */
189 #define NC_NSYNC 0x10 /* synchronise numrecs on change */
190 #define NC_HSYNC 0x20 /* synchronise whole header on change */
191 #define NC_NDIRTY 0x40 /* numrecs has changed */
192 #define NC_HDIRTY 0x80 /* header info has changed */
193 #define NC_NOFILL 0x100 /* Don't fill vars on endef and increase of record */
194 #define NC_LINK 0x8000 /* isa link */
195 
196 #define NC_FILL 0 /* argument to ncsetfill to clear NC_NOFILL */
197 
198 /*
199  * 'mode' arguments for nccreate and ncopen
200  */
201 #define NC_NOWRITE 0
202 #define NC_WRITE NC_RDWR
203 #define NC_CLOBBER (NC_INDEF | NC_CREAT | NC_RDWR)
204 #define NC_NOCLOBBER (NC_INDEF | NC_EXCL | NC_CREAT | NC_RDWR)
205 
206 /*
207  * 'size' argument to ncdimdef for an unlimited dimension
208  */
209 #define NC_UNLIMITED 0L
210 
211 /*
212  * attribute id to put/get a global attribute
213  */
214 #define NC_GLOBAL -1
215 
216 #ifndef HDF
217 /*
218  * This can be as large as the maximum number of stdio streams
219  * you can have open on your system.
220  */
221 #define MAX_NC_OPEN 32
222 
223 /*
224  * These maximums are enforced by the interface, to facilitate writing
225  * applications and utilities. However, nothing is statically allocated to
226  * these sizes internally.
227  */
228 #define MAX_NC_DIMS 5000 /* max dimensions per file */
229 #define MAX_NC_ATTRS 3000 /* max global or per variable attributes */
230 #define MAX_NC_VARS 5000 /* max variables per file */
231 #define MAX_NC_NAME 256 /* max length of a name */
232 #define MAX_VAR_DIMS 32 /* max per variable dimensions */
233 
234 /*
235  * Added feature.
236  * If you wish a variable to use a different value than the above
237  * defaults, create an attribute with the same type as the variable
238  * and the following reserved name. The value you give the attribute
239  * will be used as the fill value for that variable.
240  */
241 #define _FillValue "_FillValue"
242 
243 #else /* HDF */
244 
245 #include "hlimits.h" /* Hard coded constants for HDF library */
246 
247 #endif /* HDF */
248 
249 #ifdef USE_ENUM
250 /*
251  * The netcdf data types
252  */
253 typedef enum {
254  NC_UNSPECIFIED, /* private */
261  /* private */
268 } nc_type ;
269 #else
270 typedef int nc_type ;
271 #define NC_UNSPECIFIED 0 /* private */
272 #define NC_BYTE 1
273 #define NC_CHAR 2
274 #define NC_SHORT 3
275 #define NC_LONG 4
276 #define NC_FLOAT 5
277 #define NC_DOUBLE 6
278  /* private */
279 #define NC_BITFIELD 7
280 #define NC_STRING 8
281 #define NC_IARRAY 9
282 #define NC_DIMENSION 10
283 #define NC_VARIABLE 11
284 #define NC_ATTRIBUTE 12
285 #endif
286 
287 
288 /*
289  * C data types corresponding to netCDF data types:
290  */
291 /* Don't use these or the C++ interface gets confused
292 typedef char ncchar;
293 typedef char ncbyte;
294 typedef short ncshort;
295 typedef float ncfloat;
296 typedef double ncdouble;
297 */
298 
299 /*
300  * Variables/attributes of type NC_LONG should use the C type 'nclong'
301  */
302 #ifdef __alpha
303 typedef int nclong;
304 #else
305 typedef long nclong; /* default, compatible type */
306 #endif
307 
308 
309 /*
310  * Global netcdf error status variable
311  * Initialized in error.c
312  */
313 #define NC_NOERR 0 /* No Error */
314 #define NC_EBADID 1 /* Not a netcdf id */
315 #define NC_ENFILE 2 /* Too many netcdfs open */
316 #define NC_EEXIST 3 /* netcdf file exists && NC_NOCLOBBER */
317 #define NC_EINVAL 4 /* Invalid Argument */
318 #define NC_EPERM 5 /* Write to read only */
319 #define NC_ENOTINDEFINE 6 /* Operation not allowed in data mode */
320 #define NC_EINDEFINE 7 /* Operation not allowed in define mode */
321 #define NC_EINVALCOORDS 8 /* Coordinates out of Domain */
322 #define NC_EMAXDIMS 9 /* MAX_NC_DIMS exceeded */
323 #define NC_ENAMEINUSE 10 /* String match to name in use */
324 #define NC_ENOTATT 11 /* Attribute not found */
325 #define NC_EMAXATTS 12 /* MAX_NC_ATTRS exceeded */
326 #define NC_EBADTYPE 13 /* Not a netcdf data type */
327 #define NC_EBADDIM 14 /* Invalid dimension id */
328 #define NC_EUNLIMPOS 15 /* NC_UNLIMITED in the wrong index */
329 #define NC_EMAXVARS 16 /* MAX_NC_VARS exceeded */
330 #define NC_ENOTVAR 17 /* Variable not found */
331 #define NC_EGLOBAL 18 /* Action prohibited on NC_GLOBAL varid */
332 #define NC_ENOTNC 19 /* Not a netcdf file */
333 #define NC_ESTS 20 /* In Fortran, string too short */
334 #define NC_EMAXNAME 21 /* MAX_NC_NAME exceeded */
335 #define NC_ENTOOL NC_EMAXNAME /* Backward compatibility */
336 #define NC_EUNLIMIT 22 /* NC_UNLIMITED size already in use */
337 
338 #define NC_EXDR 32 /* */
339 #define NC_SYSERR -1
340 
341 #include "hdf2netcdf.h"
343 
344 /*
345  * Global options variable. Used to determine behavior of error handler.
346  * Initialized in lerror.c
347  */
348 #define NC_FATAL 1
349 #define NC_VERBOSE 2
350 
351 HDFLIBAPI int ncopts ; /* default is (NC_FATAL | NC_VERBOSE) */
352 
353 /*
354  * NB: The following feature-test line is too long in order to accomodate a
355  * bug in the VMS 5.3 C compiler.
356  */
357 #ifndef HAVE_PROTOTYPES
358 # if defined(__STDC__) || defined(__GNUC__) || defined(__cplusplus) || defined(c_plusplus)
359 # define HAVE_PROTOTYPES
360 # endif
361 #endif
362 
363 #undef PROTO
364 #ifdef HAVE_PROTOTYPES
365 # define PROTO(x) x
366 #else
367 # define PROTO(x) ()
368 #endif
369 
370 
371 #ifdef __cplusplus
372 extern "C" {
373 #endif
374 
376  const char* path,
377  int cmode
378 ));
379 HDFLIBAPI int ncopen PROTO((
380  const char* path,
381  int mode
382 ));
383 HDFLIBAPI int ncredef PROTO((
384  int cdfid
385 ));
386 HDFLIBAPI int ncendef PROTO((
387  int cdfid
388 ));
389 HDFLIBAPI int ncclose PROTO((
390  int cdfid
391 ));
393  int cdfid,
394  int* ndims,
395  int* nvars,
396  int* natts,
397  int* recdim
398 ));
399 HDFLIBAPI int ncsync PROTO((
400  int cdfid
401 ));
402 HDFLIBAPI int ncabort PROTO((
403  int cdfid
404 ));
405 HDFLIBAPI int ncnobuf PROTO((
406  int cdfid
407 ));
409  int cdfid,
410  const char* name,
411  long length
412 ));
413 HDFLIBAPI int ncdimid PROTO((
414  int cdfid,
415  const char* name
416 ));
418  int cdfid,
419  int dimid,
420  char* name,
421  long* length
422 ));
424  int cdfid,
425  int dimid,
426  const char* name
427 ));
429  int cdfid,
430  const char* name,
431  nc_type datatype,
432  int ndims,
433  const int* dim
434 ));
435 HDFLIBAPI int ncvarid PROTO((
436  int cdfid,
437  const char* name
438 ));
440  int cdfid,
441  int varid,
442  char* name,
443  nc_type* datatype,
444  int* ndims,
445  int* dim,
446  int* natts
447 ));
449  int cdfid,
450  int varid,
451  const long* coords,
452  const void* value
453 ));
455  int cdfid,
456  int varid,
457  const long* coords,
458  void* value
459 ));
461  int cdfid,
462  int varid,
463  const long* start,
464  const long* count,
465  const void* value
466 ));
468  int cdfid,
469  int varid,
470  const long* start,
471  const long* count,
472  void* value
473 ));
475  int cdfid,
476  int varid,
477  const long* start,
478  const long* count,
479  const long* stride,
480  const void* values
481 ));
483  int cdfid,
484  int varid,
485  const long* start,
486  const long* count,
487  const long* stride,
488  void* values
489 ));
491  int cdfid,
492  int varid,
493  const long* start,
494  const long* count,
495  const long* stride,
496  const long* imap,
497  const void* values
498 ));
500  int cdfid,
501  int varid,
502  const long* start,
503  const long* count,
504  const long* stride,
505  const long* imap,
506  void* values
507 ));
509  int cdfid,
510  int varid,
511  const char* name
512 ));
514  int cdfid,
515  int varid,
516  const char* name,
517  nc_type datatype,
518  int len,
519  const void* value
520 ));
522  int cdfid,
523  int varid,
524  const char* name,
525  nc_type* datatype,
526  int* len
527 ));
529  int cdfid,
530  int varid,
531  const char* name,
532  void* value
533 ));
535  int incdf,
536  int invar,
537  const char* name,
538  int outcdf,
539  int outvar
540 ));
542  int cdfid,
543  int varid,
544  int attnum,
545  char* name
546 ));
548  int cdfid,
549  int varid,
550  const char* name,
551  const char* newname
552 ));
554  int cdfid,
555  int varid,
556  const char* name
557 ));
559  nc_type datatype
560 ));
562  int cdfid,
563  int fillmode
564 ));
566  int cdfid,
567  int* nrecvars,
568  int* recvarids,
569  long* recsizes
570 ));
572  int cdfid,
573  long recnum,
574  void** datap
575 ));
577  int cdfid,
578  long recnum,
579  void* const* datap
580 ));
581 #ifdef __cplusplus
582 }
583 #endif
584 
585 #endif /* _NETCDF_ */
EXTERNL int ncdimid(int ncid, const char *name)
HDFFCLIBAPI intf intf intf * count
EXTERNL int ncattcopy(int ncid_in, int varid_in, const char *name, int ncid_out, int varid_out)
HDFFCLIBAPI intf * len
EXTERNL int ncrecinq(int ncid, int *nrecvarsp, int *recvaridsp, long *recsizesp)
EXTERNL int ncopen(const char *path, int mode)
nc_type
Definition: netcdf.h:253
EXTERNL int ncdiminq(int ncid, int dimid, char *name, long *lenp)
HDFFCLIBAPI _fcd _fcd intf intf * datatype
EXTERNL int ncdimrename(int ncid, int dimid, const char *name)
EXTERNL int ncrecget(int ncid, long recnum, void **datap)
EXTERNL int nccreate(const char *path, int cmode)
EXTERNL int ncsync(int ncid)
EXTERNL int ncvarrename(int ncid, int varid, const char *name)
EXTERNL int ncsetfill(int ncid, int fillmode)
EXTERNL int ncredef(int ncid)
#define ncnobuf
Definition: hdf2netcdf.h:71
EXTERNL int ncvargets(int ncid, int varid, const long *startp, const long *countp, const long *stridep, void *ip)
EXTERNL int ncattinq(int ncid, int varid, const char *name, nc_type *xtypep, int *lenp)
EXTERNL int ncattdel(int ncid, int varid, const char *name)
EXTERNL int ncendef(int ncid)
HDFLIBAPI int ncopts
Definition: netcdf.h:351
EXTERNL int ncvargetg(int ncid, int varid, const long *startp, const long *countp, const long *stridep, const long *imapp, void *ip)
EXTERNL int ncvarputg(int ncid, int varid, const long *startp, const long *countp, const long *stridep, const long *imapp, const void *op)
EXTERNL int ncinquire(int ncid, int *ndimsp, int *nvarsp, int *nattsp, int *unlimdimp)
EXTERNL int ncvarput1(int ncid, int varid, const long *indexp, const void *op)
HDFFCLIBAPI _fcd name
long nclong
Definition: netcdf.h:305
HDFFCLIBAPI intf _fcd intf intf intf * values
EXTERNL int ncclose(int ncid)
EXTERNL int ncdimdef(int ncid, const char *name, long len)
EXTERNL int ncattname(int ncid, int varid, int attnum, char *name)
EXTERNL int ncvarputs(int ncid, int varid, const long *startp, const long *countp, const long *stridep, const void *op)
#define PROTO(x)
Definition: netcdf.h:367
EXTERNL int ncvarput(int ncid, int varid, const long *startp, const long *countp, const void *op)
HDFLIBAPI int ncerr
Definition: netcdf.h:342
EXTERNL int ncattget(int ncid, int varid, const char *name, void *ip)
EXTERNL int ncrecput(int ncid, long recnum, void *const *datap)
HDFFCLIBAPI intf intf start[]
EXTERNL int ncvarget(int ncid, int varid, const long *startp, const long *countp, void *ip)
HDFFCLIBAPI intf stride[]
EXTERNL int ncattrename(int ncid, int varid, const char *name, const char *newname)
#define HDFLIBAPI
Definition: H4api_adpt.h:195
EXTERNL int ncattput(int ncid, int varid, const char *name, nc_type xtype, int len, const void *op)
EXTERNL int ncvarget1(int ncid, int varid, const long *indexp, void *ip)
EXTERNL int ncvardef(int ncid, const char *name, nc_type xtype, int ndims, const int *dimidsp)
EXTERNL int ncvarid(int ncid, const char *name)
EXTERNL int ncabort(int ncid)
EXTERNL int ncvarinq(int ncid, int varid, char *name, nc_type *xtypep, int *ndimsp, int *dimidsp, int *nattsp)
EXTERNL int nctypelen(nc_type datatype)

MISR Toolkit - Copyright © 2005 - 2020 Jet Propulsion Laboratory
Generated on Fri Jun 19 2020 22:49:52