1NETCDF(3) UNIDATA LIBRARY FUNCTIONS NETCDF(3)
2
3
4
6 netcdf - Unidata Network Common Data Form (netCDF-2) library
7
9 The interface described here is obsolete, but included because the perl
10 module still use it.
11
13 #include <netcdf.h>
14
15 int nccreate(const char* path, int cmode)
16
17 int ncopen(const char* path, int mode)
18
19 int ncredef(int ncid)
20
21 int ncsetfill(int ncid, int fillmode)
22
23 int ncendef(int ncid)
24
25 int ncclose(int ncid)
26
27 int ncinquire(int ncid, int* ndims, int* nvars, int* natts,
28 int* recdim)
29
30 int ncsync(int ncid)
31
32 int ncabort(int ncid)
33
34 int ncdimdef(int ncid, const char* name, long length)
35
36 int ncdimid(int ncid, const char* name)
37
38 int ncdiminq(int ncid, int dimid, char* name, long* length)
39
40 int ncdimrename(int ncid, int dimid, const char* name)
41
42 int ncvardef(int ncid, const char* name, nc_type datatype, int ndims,
43 const int dimids[])
44
45 int ncvarid(int ncid, const char* name)
46
47 int ncvarinq(int ncid, int varid, char* name, nc_type* datatype,
48 int* ndims, int dimids[], int* natts)
49
50 int ncvarput1(int ncid, int varid, const long coords[], const
51 void* value)
52
53 int ncvarget1(int ncid, int varid, const long coords[], void* value)
54
55 int ncvarput(int ncid, int varid, const long start[], const
56 long count[], const void* value)
57
58 int ncvarget(int ncid, int varid, const long start[], const
59 long count[], void* value)
60
61 int ncvarputg(int ncid, int varid, const long start[], const
62 long count[], const long stride[], const long imap[], const
63 void* value)
64
65 int ncvargetg(int ncid, int varid, const long start[], const
66 long count[], const long stride[], const long imap[],
67 void* value)
68
69 int ncrecput(int ncid, long recnum, void* const valuep[])
70
71 int ncrecget(int ncid, long recnum, void* valuep[])
72
73 int ncrecinq(int ncid, int* nrvars, int rvarids[], long rsizes[])
74
75 int ncvarrename(int ncid, int varid, const char* name)
76
77 int ncattput(int ncid, int varid, const char* name, nc_type datatype,
78 int len, const void* value)
79
80 int ncattinq(int ncid, int varid, const char* name, nc_type* datatype,
81 int* len)
82
83 int ncattget(int ncid, int varid, const char* name, void* value)
84
85 int ncattcopy(int inncid, int invar, const char* name, int outncid,
86 int outvar)
87
88 int ncattname(int ncid, int varid, int attnum, char* name)
89
90 int ncattrename(int ncid, int varid, const char* name, const
91 char* newname)
92
93 int ncattdel(int ncid, int varid, const char* name)
94
95 int nctypelen(nc_type datatype)
96
98 These routines implement the Unidata netCDF data-access interface for
99 the C programming language. Only those arguments which are unique to
100 the function being described are documented in this section. See the
101 section "COMMON ARGUMENT DESCRIPTIONS" for descriptions of the other
102 arguments.
103
104 int nccreate(const char* path, int cmode)
105
106 Creates the new netCDF file, returning a netCDF ID that can subse‐
107 quently be used to refer to the netCDF file. The new netCDF file
108 is placed in define mode. The mode parameter, cmode, should be ei‐
109 ther NC_CLOBBER or NC_NOCLOBBER. NC_CLOBBER means that even if the
110 file already exists, you want to create a new file with the same
111 name, erasing the old file's contents. NC_NOCLOBBER means you want
112 to create a new netCDF file only if the given file name does not
113 refer to a file that already exists. If an error occurs, this
114 function returns -1.
115
116 int ncopen(const char* path, int mode)
117
118 Opens the existing netCDF file for access. The mode parameter,
119 mode, should be either NC_WRITE, to open the file for writing, or
120 NC_NOWRITE, to open the file read-only. "Writing" means any kind
121 of change to the file, including appending or changing data, adding
122 or renaming dimensions, variables, or attributes, or deleting at‐
123 tributes. If an error occurs, this function returns -1.
124
125 int ncredef(int ncid)
126
127 Puts an open netCDF file into define mode, so dimensions, vari‐
128 ables, and attributes can be added or renamed and attributes can be
129 deleted. If an error occurs, this function returns -1.
130
131 int ncsetfill(int ncid, int fillmode)
132
133 Determines whether or not variable prefilling will be done (see
134 VARIABLE PREFILLING below). The netCDF file shall be writable.
135 fillmode is either NC_FILL to enable prefilling (the default) or
136 NC_NOFILL to disable prefilling. This function returns the previ‐
137 ous setting or -1 if an error occurs.
138
139 int ncendef(int ncid)
140
141 Takes an open netCDF file out of define mode. The changes made to
142 the netCDF file while it was in define mode are checked and commit‐
143 ted to disk if no problems occurred. In particular, non-record
144 variables are filled with their fill-values unless ncsetfill() has
145 been called with the argument NC_NOFILL. The netCDF file is then
146 placed in data mode, so that variable data can be read or written.
147 If an error occurs, this function returns -1.
148
149 int ncclose(int ncid)
150
151 Closes an open netCDF file. If the file is in define mode, ncen‐
152 def() will be called before closing. (In this case, if ncendef()
153 returns an error, ncabort() will automatically be called to restore
154 the file to the consistent state before define mode was last en‐
155 tered.) After an open netCDF file is closed, its netCDF ID will be
156 reassigned to the next netCDF file that is opened or created. If
157 an error occurs, this function returns -1.
158
159 int ncinquire(int ncid, int* ndims, int* nvars, int* natts, int*
160 recdim)
161
162 Returns information about an open netCDF file. Upon successful re‐
163 turn, ndims will contain the number of dimensions defined for this
164 netCDF file, nvars will contain the number of variables, natts will
165 contain the number of attributes, and recdim will contain the ID of
166 the unlimited dimension if one exists, or -1 otherwise. If any of
167 the return parameters is a NULL pointer, then the corresponding in‐
168 formation will not be returned; hence, no space need be allocated
169 for it. If an error occurs, this function returns -1.
170
171 int ncsync(int ncid)
172
173 Updates a writable netCDF file. The netCDF file must be in data
174 mode. A netCDF file in define mode is synchronized to disk only
175 when ncendef() is called. It can be expensive in computer re‐
176 sources to always synchronize to disk after every write of variable
177 data or change of an attribute value. There are two reasons you
178 might want to synchronize after writes: 1) to minimize data loss in
179 case of abnormal termination; and 2) to make data available to oth‐
180 er processes for reading immediately after it is written. Data is
181 automatically synchronized to disk when a netCDF file is closed, or
182 whenever you leave define mode. If an error occurs, this function
183 returns -1.
184
185 int ncabort(int ncid)
186
187 Closes or deletes a netCDF file. If the netCDF file isn't in de‐
188 fine mode, then the file is closed. If the file is being created
189 and is still in define mode, the file is deleted. If define mode
190 was entered by a call to ncredef(), the netCDF file is restored to
191 its state before definition mode was entered and the file is
192 closed. The main reason for calling ncabort() is to restore the
193 netCDF to a known consistent state in case anything goes wrong dur‐
194 ing the definition of new dimensions, variables, or attributes.
195 This function is called automatically if ncclose() is called from
196 define mode and the call to leave define mode before closing fails.
197 If an error occurs, this function returns -1.
198
199 int ncdimdef(int ncid, const char* name, long length)
200
201 Adds a new dimension to an open netCDF file, which must be in de‐
202 fine mode. name is the dimension name. If an error occurs, this
203 function returns -1.
204
205 int ncdimid(int ncid, const char* name)
206
207 Returns the ID of a netCDF dimension, given the name of the dimen‐
208 sion. If an error occurs, this function returns -1.
209
210 int ncdiminq(int ncid, int dimid, char* name, long* size)
211
212 Returns the name and size of a dimension, given its ID. If either
213 the name parameter or size parameter is a NULL pointer, the associ‐
214 ated information will not be returned, so no space needs to be al‐
215 located. For the unlimited dimension, the returned size is the
216 current maximum value used for writing any record variables, (i.e.
217 the maximum record number). If an error occurs, this function re‐
218 turns -1.
219
220 int ncdimrename(int ncid, int dimid, const char* name)
221
222 Renames an existing dimension in an open netCDF file. If the new
223 name is longer than the old name, the netCDF must be in define
224 mode. You cannot rename a dimension to have the same name as an‐
225 other dimension. If an error occurs, this function returns -1.
226
227 int ncvardef(int ncid, const char* name, nc_type datatype, int ndims,
228 const int dimids[])
229
230 Adds a new variable to an open netCDF file in define mode. It re‐
231 turns a netCDF variable ID. If an error occurs, this function re‐
232 turns -1.
233
234 int ncvarid(int ncid, const char* name)
235
236 Returns the ID of a netCDF variable, given its name. If an error
237 occurs, this function returns -1.
238
239 int ncvarinq(int ncid, int varid, char* name, nc_type* datatype, int*
240 ndims, int dimids[], int* natts)
241
242 Returns information about a netCDF variable, given its ID. If any
243 of the return parameters (name, datatype, ndims, dimids, or natts)
244 is a NULL pointer, then the corresponding information will not be
245 returned; hence, no space need be allocated for it. If an error
246 occurs, this function returns -1.
247
248 int ncvarput1(int ncid, int varid, const long coords[], const void*
249 value)
250
251 Puts a single data value into a variable of an open netCDF file
252 that is in data mode. If an error occurs, this function returns
253 -1.
254
255 int ncvarget1(int ncid, int varid, const long coords[], void* value)
256
257 Gets a single data value from a variable of an open netCDF file
258 that is in data mode. If an error occurs, this function returns
259 -1.
260
261 int ncvarput(int ncid, int varid, const long start[], const long
262 count[], const void* value)
263
264 Writes a hyperslab of values into a netCDF variable of an open
265 netCDF file, which must be in data mode. If an error occurs, this
266 function returns -1.
267
268 int ncvarget(int ncid, int varid, const long start[], const long
269 count[], void* value)
270
271 Reads a hyperslab of values from a netCDF variable of an open
272 netCDF file, which must be in data mode. If an error occurs, this
273 function returns -1.
274
275 int ncvarputg(int ncid, int varid, const long start[], const long
276 count[], const long stride[], const long imap[], const void* value)
277
278 Writes a general hyperslab of values into a netCDF variable of an
279 open netCDF file, which must be in data mode. The locations of the
280 memory-resident data values may be arbitrary, though they are con‐
281 strained to have a regular structure. In addition, the values of
282 the netCDF variable may be accessed using non-unity strides. If an
283 error occurs, this function returns -1.
284
285 int ncvargetg(int ncid, int varid, const long start[], const long
286 count[], const long stride[], const long imap[], void* value)
287
288 Reads a general hyperslab of values from a netCDF variable of an
289 open netCDF file, which must be in data mode. The locations of the
290 memory-resident data values may be arbitrary, though they are con‐
291 strained to have a regular structure. In addition, the values of
292 the netCDF variable may be accessed using non-unity strides. If an
293 error occurs, this function returns -1.
294
295 int ncrecput(int ncid, long recnum, const void* valuep[])
296
297 Writes a record (or a subset of a record) of values into the record
298 variables of an open netCDF file, which must be in data mode. The
299 record number, recnum, must be a nonnegative number that specifies
300 which record (which value of the unlimited or record dimension) to
301 write. The array of pointers to blocks of data to be written, val‐
302 uep, should have one pointer for each record variable. The pointer
303 to the data to be written to the n-th record variable, valuep[n],
304 points to one record's worth of data of the appropriate type to be
305 written into the recnum-th record of that netCDF variable. If the
306 pointer for any record variable is the NULL pointer, no data is
307 written for that variable. Hence any subset of record variables
308 may be written by specifying non-NULL pointers for the desired
309 record variables. Invoking this function is equivalent to a se‐
310 quence of invocations of ncvarput() for all record variables for
311 which a non-NULL pointer is specified. If an error occurs, this
312 function returns -1.
313
314 int ncrecget(int ncid, long recnum, void* valuep[])
315
316 Reads a record (or a subset of a record) of values from the record
317 variables of an open netCDF file, which must be in data mode. The
318 record number, recnum, must be a nonnegative number that specifies
319 which record to read. The array of pointers to blocks of data to
320 be read, valuep, should have one pointer for each record variable.
321 The pointer to the data to be read for the n-th record variable,
322 valuep[n], shall point to enough space to hold one record's worth
323 of data of the appropriate type for that netCDF record variable.
324 If the pointer for any record variable is the NULL pointer, no data
325 is read from that variable. Hence any subset of record variables
326 may be read by specifying non-NULL pointers for only the desired
327 record variables. Invoking this function is equivalent to a se‐
328 quence of invocations of ncvarget() for all record variables for
329 which a non-NULL pointer is specified. If an error occurs, this
330 function returns -1.
331
332 int ncrecinq(int ncid, int* nrvars, int rvarids[], long rsizes[])
333
334 Returns information about the record variables (variables that use
335 the unlimited dimension) of an open netCDF file. Upon successful
336 return, nrvars will contain the number of record variables, rvarids
337 will contain the variable IDs of those record variables, and rsizes
338 will contain the size in bytes for a record's worth of data for
339 each record variable. If any of the return parameters (nrvars,
340 rvarids, or rsizes) is a NULL pointer, the specified information
341 will not be returned; hence no space needs to be allocated for it.
342 If an error occurs, this function returns -1.
343
344 int ncvarrename(int ncid, int varid, const char* name)
345
346 Changes the name of a netCDF variable in an open netCDF. If the
347 new name is longer than the old name, the netCDF must be in define
348 mode. You cannot rename a variable to have the name of any exist‐
349 ing variable. If an error occurs, this function returns -1.
350
351 int ncattput(int ncid, int varid, const char* name, nc_type datatype,
352 int len, const void* value)
353
354 Adds or changes a variable attribute or global attribute of an open
355 netCDF file. If this attribute is new, or if the space required to
356 store the attribute is greater than before, the netCDF file must be
357 in define mode. If an error occurs, this function returns -1.
358
359 int ncattinq(int ncid, int varid, const char* name, nc_type* datatype,
360 int* len)
361
362 Returns information about a netCDF attribute, given its variable ID
363 and name. The information returned is the type and length of the
364 attribute. If either of the return parameters is a NULL pointer,
365 the specified information will not be returned; hence no space
366 needs to be allocated for it. If an error occurs, this function
367 returns -1.
368
369 int ncattget(int ncid, int varid, const char* name, void* value)
370
371 Gets the value(s) of a netCDF attribute, given its variable ID and
372 name. All elements of the vector of attribute values are returned,
373 so you must allocate enough space to hold them. If you don't know
374 how much space to reserve, call ncattinq() first to find out the
375 length of the attribute. If an error occurs, this function returns
376 -1.
377
378 int ncattcopy(int inncid, int invar, const char* name, int outncid, int
379 outvar)
380
381 Copies an attribute from one open netCDF file to another. It can
382 also be used to copy an attribute from one variable to another
383 within the same netCDF. inncid is the netCDF ID of an input netCDF
384 file from which the attribute will be copied. invar is the ID of
385 the variable in the input netCDF file from which the attribute will
386 be copied, or NC_GLOBAL for a global attribute. name is the name
387 of the attribute in the input netCDF file to be copied. outncid is
388 the netCDF ID of the output netCDF file to which the attribute will
389 be copied. It is permissible for the input and output netCDF IDs
390 to be the same. The output netCDF file should be in define mode if
391 the attribute to be copied does not already exist for the target
392 variable, or if it would cause an existing target attribute to
393 grow. outvar is the ID of the variable in the output netCDF file
394 to which the attribute will be copied, or NC_GLOBAL to copy to a
395 global attribute. If an error occurs, this function returns -1.
396
397 int ncattname(int ncid, int varid, int attnum, char* name)
398
399 Gets the name of an attribute, given its variable ID and number as
400 an attribute of that variable. This function is useful in generic
401 applications that need to get the names of all the attributes asso‐
402 ciated with a variable, since attributes are accessed by name
403 rather than number in all other attribute functions. The number of
404 an attribute is more volatile than the name, since it can change
405 when other attributes of the same variable are deleted. This is
406 why an attribute number is not called an attribute ID. attnum is
407 the number of the attribute. The attributes for each variable are
408 numbered from 0 (the first attribute) to nvatts-1, where nvatts is
409 the number of attributes for the variable, as returned from a call
410 to ncvarinq(). If the name parameter is a NULL pointer, no name
411 will be returned and no space need be allocated. If an error oc‐
412 curs, this function returns -1.
413
414 int ncattrename(int ncid, int varid, const char* name, const char* new‐
415 name)
416
417 Changes the name of an attribute. If the new name is longer than
418 the original name, the netCDF must be in define mode. You cannot
419 rename an attribute to have the same name as another attribute of
420 the same variable. name is the original attribute name. newname
421 is the new name to be assigned to the specified attribute. If the
422 new name is longer than the old name, the netCDF file must be in
423 define mode. If an error occurs, this function returns -1.
424
425 int ncattdel(int ncid, int varid, const char* name)
426
427 Deletes a netCDF attribute from an open netCDF file. The netCDF
428 file must be in define mode. If an error occurs, this function re‐
429 turns -1.
430
431 int nctypelen(nc_type datatype)
432
433 Returns the number of bytes in a netCDF data type. If an error oc‐
434 curs, this function returns -1.
435
437 char* name
438 is the name of a dimension, variable, or attribute. It shall begin
439 with an alphabetic character, followed by zero or more alphanumeric
440 characters including the underscore (`_'). Case is significant.
441 As an input argument, it shall be a pointer to a 0-terminated
442 string; as an output argument, it shall be the address of a buffer
443 in which to hold such a string. The maximum allowable number of
444 characters (excluding the terminating 0) is MAX_NC_NAME. Attribute
445 names that begin with an underscore (`_') are reserved for use by
446 the netCDF interface.
447
448 char* path
449 is the pathname of a netCDF file. It may be absolute or relative.
450
451 int ncid
452 is the netCDF ID returned from a previous, successful call to
453 ncopen() or nccreate().
454
455 int dimids[]
456 is a vector of dimension ID's and defines the shape of a netCDF
457 variable. The size of the vector shall be greater than or equal to
458 the rank (i.e. the number of dimensions) of the variable (ndims).
459 The vector shall be ordered by the speed with which a dimension
460 varies: dimids[ndims-1] shall be the dimension ID of the most
461 rapidly varying dimension and dimids[0] shall be the dimension ID
462 of the most slowly varying dimension. Consequently, if a variable
463 is a record variable, then dimids[0] shall be the dimension ID of
464 the record dimension. The maximum possible number of dimensions
465 for a variable is given by the symbolic constant MAX_VAR_DIMS.
466
467 int dimid
468 is the ID of a netCDF dimension. netCDF dimension ID's are allo‐
469 cated sequentially from the non-negative integers beginning with 0.
470
471 int len
472 is the number of values associated with an attribute. If the at‐
473 tribute is of type NC_CHAR, then this is one more than the string
474 length (since the terminating 0 is stored).
475
476 int ndims
477 is either the total number of dimensions in a netCDF dataset or the
478 rank (i.e. the number of dimensions) of a netCDF variable. The
479 value shall not be negative or greater than the symbolic constant
480 MAX_VAR_DIMS.
481
482 int varid
483 is the ID of a netCDF variable or (for the attribute-access func‐
484 tions) the symbolic constant NC_GLOBAL, which is used to reference
485 global attributes. netCDF variable ID's are allocated sequentially
486 from the non-negative integers beginning with 0.
487
488 int natts
489 is the number of global attributes in a netCDF dataset for the nc‐
490 inquire() function or the number of attributes associated with a
491 netCDF variable for the ncvarinq() function.
492
493 long imap[]
494 is the index mapping vector that specifies how data values associ‐
495 ated with a netCDF variable are arranged in memory. The offset, in
496 bytes, from the memory location pointed to by the value argument to
497 a particular datum is given by the inner (dot) product of the index
498 mapping vector with the coordinates of the datum. For example, on
499 a machine where `sizeof(float) == 4', the index mapping vector for
500 the array `float u[3][5];' is `long imap[2] = {20,4}'. Note that
501 the index mapping vector can be used to access memory-resident data
502 values in a manner that differs radically from the nominal struc‐
503 ture of the associated netCDF variable. For example, the following
504 definitions
505
506 struct vel {
507 int flags;
508 float u;
509 float v;
510 } vel[NX][NY];
511 long imap[2] = {
512 sizeof(struct vel),
513 sizeof(struct vel)*NY};
514
515
516 can be used to access the memory-resident values of the netCDF
517 variable, `u[NY][NX]', even though the dimensions are transposed
518 and the data is contained in a 2-D array of structures rather than
519 a 2-D array of floating-point values. The index mapping vector may
520 contain negative values if the value argument is appropriately set.
521 A NULL index mapping vector argument obtains the default behavior
522 in which the memory-resident values are assumed to have the same
523 structure as the associated netCDF variable.
524
525 long coords[]
526 specifies the indicial coordinates of the netCDF data value to be
527 accessed. The indices are relative to 0; thus, for example, the
528 first data value of a two-dimensional variable is (0,0). The size
529 of the vector shall be at least the rank of the associated netCDF
530 variable and its elements shall correspond, in order, to the vari‐
531 able's dimensions. Consequently, if the variable is a record vari‐
532 able, then the first index is the record number.
533
534 long count[]
535 specifies the number of data values to be accessed in terms of the
536 lengths of the sides of the hyperslab. Thus, to access a single
537 value, for example, specify count as (1, 1, ..., 1). Note that,
538 for generalized hyperslab I/O, this argument must be adjusted to be
539 compatible with the stride and start arguments so that the interac‐
540 tion of the three does not attempt to access an invalid data co-or‐
541 dinate. For example, to access every stride(i)'th datum along di‐
542 mension i beginning with point start(i), counts(i) should be
543 1+(npts(i)-1-start(i))/stride(i): where npts(i) is the size of di‐
544 mension i. The size of the count vector shall be at least the rank
545 of the associated netCDF variable and its elements shall corre‐
546 spond, in order, to the variable's dimensions. Consequently, if
547 the variable is a record variable, then the first element of count
548 is the number of records to access.
549
550 long length
551 is the size of a netCDF dimension. As an input argument, it shall
552 be a positive integer or the symbolic constant NC_UNLIMITED. At
553 most one such unlimited size dimension, called the record dimen‐
554 sion, shall be defined in a netCDF dataset. As an output argument,
555 it shall be a positive integer.
556
557 long start[]
558 specifies the starting point for accessing a netCDF variable's data
559 values in terms of the indicial coordinates of the corner of the
560 hyperslab. The indices are relative to 0; thus, the first data
561 value of a variable is (0, 0, ..., 0). The size of the vector
562 shall be at least the rank of the associated netCDF variable and
563 its elements shall correspond, in order, to the variable's dimen‐
564 sions. Consequently, if the variable is a record variable, then
565 the first index is the starting record number for accessing the
566 netCDF variable's data values.
567
568 long stride[]
569 specifies, for each dimension, the interval between the accessed
570 values of a netCDF variable. The size of the vector shall be at
571 least the rank of the associated netCDF variable and its elements
572 shall correspond, in order, to the variable's dimensions. A value
573 of 1 accesses adjacent values of the netCDF variable in the corre‐
574 sponding dimension; a value of 2 accesses every other value of the
575 netCDF variable in the corresponding dimension; and so on. At‐
576 tempting to access a data value that lies outside the defined data
577 space of a variable is an error. A NULL stride argument obtains
578 the default behavior in which adjacent values are accessed along
579 each dimension.
580
581 nc_type datatype
582 specifies the data type of a netCDF variable and is one of the fol‐
583 lowing: NC_BYTE, NC_CHAR, NC_SHORT, NC_LONG, NC_FLOAT, or NC_DOU‐
584 BLE.
585
586 void* value
587 points to the start of the memory-resident data values to be ac‐
588 cessed. The pointer is declared to be of type void* because it can
589 point to data of any of the basic netCDF types. The data should be
590 of the appropriate type for the netCDF variable:
591
592
593 netCDF Type C Type
594
595
596 NC_BYTE unsigned char
597 NC_CHAR char
598 NC_SHORT short
599 NC_LONG nclong
600 NC_FLOAT float
601 NC_DOUBLE double
602
603 NOTE: The C type corresponding to the netCDF type NC_LONG is nc‐
604 long. This type is defined in the netCDF header file and is guar‐
605 anteed to hold at least 32 bits. It is defined as either a C `int'
606 or a C `long' -- depending on the platform.
607
608 Warning: neither the compiler nor the netCDF software can detect if
609 the wrong type of data is used.
610
612 By default, the netCDF interface sets the values of all newly-defined
613 variables of finite length (i.e. not having an unlimited, record dimen‐
614 sion) to the type-dependent fill-value associated with each variable.
615 This is done when `ncendef()' is called. The fill-value for a variable
616 may be changed from the default value by defining the attribute `_Fill‐
617 Value' for the variable. This attribute must have the same type as the
618 variable and be of length one.
619
620 Variables with an unlimited record dimension are also prefilled, but on
621 an `as needed' basis. For example, if the first write of a record
622 variable is to position 5, then positions 0 through 4 (and no others)
623 would be set to the fill-value at the same time.
624
625 This default prefilling of data values may be disabled by calling the
626 function ncsetfill() with the argument NC_NOFILL. Note that, for non-
627 record variables, this call must be made before ncendef(); whereas, for
628 record-variables, this call may be made at any time.
629
630 One can obtain increased performance of the netCDF interface by using
631 this feature, but only at the expense of requiring the application to
632 set every single data value.
633
635 The global variable `ncopts', which is defined in `netcdf.h', affects
636 the actions of the netCDF interface. It may be set by the user to the
637 bitwise OR of any of the following, non-zero, symbolic bit-values:
638
639 NC_VERBOSE Print error-messages on standard error.
640
641 NC_FATAL Abort. Call `exit()' with an error-condition if an error
642 occurs.
643
644 By default, `ncopts' is `NC_VERBOSE | NC_FATAL'.
645
647 NETCDF_FFIOSPEC
648 Specifies the Flexible File I/O buffers for netCDF I/O when execut‐
649 ing under the UNICOS operating system (the variable is ignored on
650 other operating systems). An appropriate specification can greatly
651 increase the efficiency of netCDF I/O -- to the extent that it can
652 actually surpass FORTRAN binary I/O. The default specification is
653 bufa:336:2. See UNICOS Flexible File I/O for more information.
654
656 Both a mailing list and a digest are available for discussion of the
657 netCDF interface and announcements about netCDF bugs, fixes, and en‐
658 hancements. To begin or change your subscription to either the mail‐
659 ing-list or the digest, send one of the following in the body (not the
660 subject line) of an email message to "Majordomo@unidata.ucar.edu". Use
661 your email address in place of jdoe@host.inst.domain.
662
663 To subscribe to the netCDF mailing list:
664 subscribe netcdfgroup jdoe@host.inst.domain
665 To unsubscribe from the netCDF mailing list:
666 unsubscribe netcdfgroup jdoe@host.inst.domain
667 To subscribe to the netCDF digest:
668 subscribe netcdfdigest jdoe@host.inst.domain
669 To unsubscribe from the netCDF digest:
670 unsubscribe netcdfdigest jdoe@host.inst.domain
671 To retrieve the general introductory information for the mailing list:
672 info netcdfgroup
673 To get a synopsis of other majordomo commands:
674 help
675
677 ncdump(1), ncgen(1), netcdf(3f).
678
679 netCDF User's Guide, published by the Unidata Program Center, Universi‐
680 ty Corporation for Atmospheric Research, located in Boulder, Colorado.
681
682
683
684Printed: 119.6.20 26 February 1993 NETCDF(3)