1NETCDF(3f90) UNIDATA LIBRARY FUNCTIONS NETCDF(3f90)
2
3
4
6 netcdf - Unidata Network Common Data Form (netCDF) library, version 3
7 interface
8
10 use netcdf
11
12
13 Most Systems:
14 f90 ... -lnetcdf
15
16
17 CRAY PVP Systems:
18 f90 -dp -i64 ... -lnetcdf
19
20
22 This document describes version 3 of Unidata netCDF data-access inter‐
23 face for the Fortran-90 programming language.
24
25 character*80 nf90_inq_libvers()
26 character(len=80) :: nf90_inq_libvers
27
28 Returns a string identifying the version of the netCDF library, and
29 when it was built, like: "3.1a of Aug 22 1996 12:57:47 $".
30
31 The RCS ident(1) command will find a string like "$Id: @(#) netcdf li‐
32 brary version 3.1a of Sep 6 1996 15:56:26 $" in the library. The SCCS
33 what(1) command will find a string like "netcdf library version 3.1a of
34 Aug 23 1996 16:07:40 $".
35
37 All netCDF functions (except nf90_inq_libvers() and nf90_strerror())
38 return an integer status. This behavior replaces the rcode argument
39 used in previous versions of the library. If this returned status val‐
40 ue is not equal to nf90_noerr (zero), it indicates that an error oc‐
41 curred. The possible status values are defined in the module netcdf.
42
43 function nf90_strerror(ncerr)
44 integer, intent(in) :: ncerr
45 character(len=80) :: nf90_strerror
46
47 Returns a string textual translation of the ncerr value, like
48 "Attribute or variable name contains illegal characters" or "No
49 such file or directory".
50
51 function nf90_create(path, cmode, ncid)
52 character(len=*), intent(in) :: path
53 integer, intent(in) :: cmode
54 integer, optional, intent(in) :: initialsize
55 integer, optional, intent(inout) :: chunksize
56 integer, intent(out) :: ncid
57 integer :: nf90_create
58
59 (Corresponds to nccre() in version 2)
60
61 Creates a new netCDF dataset at path, returning a netCDF ID in
62 ncid. The argument cmode may include the bitwise-or of the fol‐
63 lowing flags: nf90_noclobber to protect existing datasets (de‐
64 fault silently blows them away), nf90_share for synchronous
65 dataset updates (default is to buffer accesses), and nf90_lock
66 (not yet implemented). When a netCDF dataset is created, is is
67 opened nf90_write. The new netCDF dataset is in define mode.
68
69 The optional argument initialsize sets the initial size of the
70 file at creation time.
71
72 See nf__open() below for an explanation of the optional chunk‐
73 size argument.
74
75 function nf90_open(path, mode, ncid, chunksize)
76 character(len=*), intent(in) :: path
77 integer, intent(in) :: mode
78 integer, intent(out) :: ncid
79 integer, optional, intent(inout) :: chunksize
80 integer :: nf90_open
81
82 (Corresponds to ncopn() in version 2)
83
84 Opens a existing netCDF dataset at path returning a netCDF ID in
85 ncid. As of NetCDF version 4.1, and if DAP support was enabled
86 when the library was built, the path may instead specify a DAP
87 URL (refer to the NetCDF user's manual for details).
88
89 The type of access is described by the mode parameter, which may
90 include the bitwise-or of the following flags: nf90_write for
91 read-write access (default read-only), nf90_share for synchro‐
92 nous dataset updates (default is to buffer accesses), and
93 nf90_lock (not yet implemented).
94
95 The optional argument referenced by chunksize controls a space
96 versus time tradeoff, memory allocated in the netcdf library
97 versus number of system calls. Because of internal require‐
98 ments, the value may not be set to exactly the value requested.
99 The actual value chosen is returned by reference. Using the
100 value nf90_sizehint_default causes the library to choose a de‐
101 fault. How the system choses the default depends on the system.
102 On many systems, the "preferred I/O block size" is available
103 from the stat() system call, struct stat member st_blksize. If
104 this is available it is used. Lacking that, twice the system pa‐
105 gesize is used. Lacking a call to discover the system pagesize,
106 we just set default chunksize to 8192.
107
108 The chunksize is a property of a given open netcdf descriptor
109 ncid: it is not a persistent property of the netcdf dataset.
110
111 function nf90_set_fill(ncid, fillmode, old_mode)
112 integer, intent(in) :: ncid, fillmode
113 integer, intent(out) :: old_mode
114 integer :: nf90_set_fill
115
116 Sets the fill-mode for a netCDF dataset to optimize writes under
117 some circumstances. The fill-mode argument, fillmode, can be
118 either nf90_fill or nf90_nofill. nf90_fill causes fill-values
119 to be written into non-record variables and into skipped-over
120 records when writing beyond the last valid record. nf90_nofill
121 suspends this behavior. The default behavior corresponds to
122 nf90_fill.
123
124 The previous fill-mode value is return in old_mode.
125
126 The fill-mode is a property of a given open netcdf descriptor
127 ncid: it is not a persistent property of the netcdf dataset.
128
129 function nf90_redef(ncid)
130 integer, intent(in) :: ncid
131 integer :: nf90_redef
132
133 (Corresponds to ncredf() in version 2)
134
135 Puts an open netCDF dataset into define mode, so dimensions,
136 variables, and attributes can be added or renamed and attributes
137 can be deleted.
138
139 function nf90_enddef(ncid, h_minfree, v_align, v_minfree, r_align)
140 integer, intent(in) :: ncid
141 integer, optional, intent(in) :: h_minfree, v_align
142 integer, optional, intent(in) :: v_minfree, r_align
143 integer :: nf90_enddef
144
145 (Corresponds to ncendf() in version 2)
146
147 Takes an open netCDF dataset out of define mode. The changes
148 made to the netCDF dataset while it was in define mode are
149 checked and committed to disk if no problems occurred. Some da‐
150 ta values may be written as well, see "VARIABLE PREFILLING" be‐
151 low. After a successful call, variable data can be read or
152 written to the dataset.
153
154 The optional arguments are performance tuning parameters. They
155 exposes internals of the netcdf version 1 file format and may
156 not be available on future netcdf implementations.
157
158 The current netcdf file format has three sections, the "header"
159 section, the data section for fixed size variables, and the data
160 section for variables which have an unlimited dimension (record
161 variables). The header begins at the beginning of the file. The
162 index (offset) of the beginning of the other two sections is
163 contained in the header. Typically, there is no space between
164 the sections. This causes copying overhead to accrue if one
165 wishes to change the size of the sections, as may happen when
166 changing names of things, text attribute values, adding at‐
167 tributes or adding variables. Also, for buffered i/o, there may
168 be advantages to aligning sections in certain ways.
169
170 The minfree parameters allow one to control costs of future
171 calls to nf90_redef(), nf90_enddef() by requesting that minfree
172 bytes be available at the end of the section. The h_minfree pa‐
173 rameter sets the pad at the end of the "header" section. The
174 v_minfree parameter sets the pad at the end of the data section
175 for fixed size variables.
176
177 The align parameters allow one to set the alignment of the be‐
178 ginning of the corresponding sections. The beginning of the sec‐
179 tion is rounded up to an index which is a multiple of the align
180 parameter. The flag value nf90_align_chunk tells the library to
181 use the chunksize (see above) as the align parameter. The
182 v_align parameter controls the alignment of the beginning of the
183 data section for fixed size variables. The r_align parameter
184 controls the alignment of the beginning of the data section for
185 variables which have an unlimited dimension (record variables).
186
187 The file format requires mod 4 alignment, so the align parame‐
188 ters are silently rounded up to multiples of 4. The usual call,
189 nf90_enddef(ncid) is equivalent to nf__enddef(ncid, 0, 4, 0, 4).
190
191 The file format does not contain a "record size" value, this is
192 calculated from the sizes of the record variables. This unfortu‐
193 nate fact prevents us from providing minfree and alignment con‐
194 trol of the "records" in a netcdf file. If you add a variable
195 which has an unlimited dimension, the third section will always
196 be copied with the new variable added.
197
198 function nf90_sync(ncid)
199 integer, intent(in) :: ncid
200 integer :: nf90_sync
201
202 (Corresponds to ncsnc() in version 2)
203
204 Unless the nf90_share bit is set in nf90_open() or nf90_cre‐
205 ate(), accesses to the underlying netCDF dataset are buffered by
206 the library. This function synchronizes the state of the under‐
207 lying dataset and the library. This is done automatically by
208 nf90_close() and nf90_enddef().
209
210 function nf90_abort(ncid)
211 integer, intent(in) :: ncid
212 integer :: nf90_abort
213
214 (Corresponds to ncabor() in version 2)
215
216 You don't need to call this function. This function is called
217 automatically by nf90_close() if the netCDF dataset was in de‐
218 fine mode and something goes wrong with the commit. If the
219 netCDF dataset isn't in define mode, then this function is
220 equivalent to nf90_close(). If it is called after nf90_redef(),
221 but before nf90_enddef(), the new definitions are not committed
222 and the dataset is closed. If it is called after nf90_create()
223 but before nf90_enddef(), the dataset disappears.
224
225 function nf90_close(ncid)
226 integer, intent(in) :: ncid
227 integer :: nf90_close
228
229 (Corresponds to ncclos() in version 2)
230
231 Closes an open netCDF dataset. If the dataset is in define
232 mode, nf90_enddef() will be called before closing. After a
233 dataset is closed, its ID may be reassigned to another dataset.
234
235 function nf90_inquire(ncid, ndims, nvars, natts, unlimdimid, nformat)
236 integer, intent(in) :: ncid
237 integer, optional, intent(out) :: ndims, nvars
238 integer, optional, intent(out) :: natts, unlimdimid
239 integer, optional, intent(out) :: nformat
240 integer :: nf90_inquire
241
242 Inquire about an open netCDF dataset. ncid is the netCDF ID of
243 the open dataset. Upon successful return, ndims will contain
244 the number of dimensions defined for this netCDF dataset, nvars
245 will contain the number of variables, natts will contain the
246 number of attributes, and unlimdimid will contain the dimension
247 ID of the unlimited dimension if one exists, or 0 otherwise.
248 nformat will contain the format version number, rarely needed
249 because the library detects the format version and behaves ap‐
250 propriately.
251
252 function nf90_def_dim(ncid, name, len, dimid)
253 integer, intent(in) :: ncid
254 character(len=*), intent(in) :: name
255 integer, intent(in) :: len
256 integer, intent(out) :: dimid
257 integer :: nf90_def_dim
258
259 (Corresponds to ncddef() in version 2)
260
261 Adds a new dimension to an open netCDF dataset, which must be in
262 define mode. name is the dimension name. len is the size of
263 the new dimension or nf90_unlimited to define the unlimited di‐
264 mension. On return, dimid will contain the dimension ID of the
265 newly created dimension.
266
267 function nf90_inq_dimid(ncid, name, dimid)
268 integer, intent(in) :: ncid
269 character(len=*), intent(in) :: name
270 integer, intent(out) :: dimid
271 integer :: nf90_inq_dimid
272
273 (Corresponds to ncdid() in version 2)
274
275 Given an open netCDF dataset and dimension name, returns the di‐
276 mension ID of the netCDF dimension in dimid.
277
278 function nf90_inquire_dimension(ncid, dimid, name, len)
279 integer, intent(in) :: ncid, dimid
280 character(len=*), optional, intent(out) :: name
281 integer, optional, intent(out) :: len
282 integer :: nf90_inquire_dimension
283
284 Inquire about a dimension. name should be big enough
285 (nf90_max_name) to hold the dimension name as the name will be
286 copied into your storage. The length return parameter, len will
287 contain the size of the dimension. For the unlimited dimension,
288 the returned length is the current maximum value used for writ‐
289 ing into any of the variables which use the dimension.
290
291 function nf90_rename_dim(ncid, dimid, name)
292 integer, intent(in) :: ncid
293 character(len=*), intent(in) :: name
294 integer, intent(in) :: dimid
295 integer :: nf90_rename_dim
296
297 (Corresponds to ncdren() in version 2)
298
299 Renames an existing dimension in an open netCDF dataset. If the
300 new name is longer than the old name, the netCDF dataset must be
301 in define mode. You cannot rename a dimension to have the same
302 name as another dimension.
303
304 function nf90_def_var(ncid, name, xtype, dimids, varid)
305 integer, intent(in) :: ncid
306 character(len=*), intent(in) :: name
307 integer, intent(in) :: xtype
308 integer, optional, dimension(:), intent(in) :: dimids
309 integer :: nf90_def_var
310
311 (Corresponds to ncvdef() in version 2)
312
313 Adds a new variable to a netCDF dataset. The netCDF must be in
314 define mode. name will be the name of the netCDF variable.
315 xtype is the external, netCDF type of the variable and should be
316 one of nf90_byte, nf90_char, nf90_short, nf90_int, nf90_float,
317 or nf90_double, The optional dimids argument contains the dimen‐
318 sion ID-s of the domain of the netCDF variable and, consequent‐
319 ly, determines the rank of the created variable: if dimids is
320 omitted, then the netCDF variable will be a scalar; if dimids is
321 a scalar, then the netCDF variable will be 1 dimensional; and if
322 dimids is a vector, then the netCDF variable will have rank
323 equal to the number of elements in dimids. varid will be set to
324 the netCDF variable ID.
325
326 function nf90_inq_varid(ncid, name, varid)
327 integer, intent(in) :: ncid
328 character(len=*), intent(in) :: name
329 integer, intent(out) :: varid
330 integer :: nf90_inq_varid
331
332 (Corresponds to ncvid() in version 2)
333
334 Returns the ID of a netCDF variable in varid given an open
335 netCDF dataset and the name of the variable.
336
337 function nf90_inquire_variable(ncid, varid, name, xtype, ndims, dimids,
338 natts)
339 integer, intent(in) :: ncid, varid
340 character(len=*), optional, intent(out) :: name
341 integer, optional, intent(out) :: xtype, ndims
342 integer, dimension(*), optional, intent(out) :: dimids
343 integer, optional, intent(out) :: natts
344 integer :: nf90_inquire_variable
345
346 Inquire about a netCDF variable in an open netCDF dataset, given
347 its variable ID. On return, name will contain the name of the
348 variable and should be capacious enough (nf90_max_name). xtype
349 will contain the external, netCDF type of the variable. ndims
350 will contain the dimensionality of the netCDF variable: if the
351 variable is a scalar, then size(ndims) will be zero; otherwise,
352 size(ndims) will be the rank of the variable and ndims will con‐
353 tain the dimension ID-s of the netCDF dimensions that constitute
354 the domain of the variable. natts will contain the number of
355 attributes associated with the netCDF variable.
356
357 function nf90_rename_var(ncid, varid, name)
358 integer, intent9in) :: ncid, varid
359 character(len=*), intent(in) :: newname
360 integer :: nf90_rename_var
361
362 (Corresponds to ncvren() in version 2)
363
364 Changes the name of a netCDF variable. If the new name is
365 longer than the old name, the netCDF must be in define mode.
366 You cannot rename a variable to have the name of any existing
367 variable.
368
369 function nf90_put_var(ncid, varid, values, start, stride, imap)
370 integer, intent(in) :: ncid, varid
371 <<whatever>>, intent(in) :: values
372 integer, dimension(:), optional, intent(in) :: start
373 integer, dimension(:), optional, intent(in) :: stride
374 integer, dimension(:), optional, intent(in) :: imap
375 integer :: nf90_put_var
376
377 (Replaces ncvpt() in version 2)
378
379 Writes a value or values to a netCDF variable. The netCDF
380 dataset must be open and in data mode. values contains the val‐
381 ue(s) what will be written to the netCDF variable identified by
382 ncid and varid; it may be a scalar or an array and must be of
383 type character, integer(kind=OneByteInt), inte‐
384 ger(kind=TwoByteInt), integer(kind=FourByteInt), inte‐
385 ger(kind=EightByteInt), real(kind=FourByteReal), or re‐
386 al(kind=EightByteReal). All values are converted to the exter‐
387 nal type of the netCDF variable, if possible; otherwise, an
388 nf90_erange error is returned. The optional argument start
389 specifies the starting index in the netCDF variable for writing
390 for each dimension of the netCDF variable. The optional argu‐
391 ment stride specifies the sampling stride (the interval between
392 accessed values in the netCDF variable) for each dimension of
393 the netCDF variable (see COMMON ARGUMENT DESCRIPTIONS below).
394 The optional argument imap specifies the in-memory arrangement
395 of the data values (see COMMON ARGUMENT DESCRIPTIONS below).
396
397 function nf90_get_var(ncid, varid, values, start, stride, imap)
398 integer, intent(in) :: ncid, varid
399 <<whatever>>, intent(out) :: values
400 integer, dimension(:), optional, intent(in) :: start
401 integer, dimension(:), optional, intent(in) :: stride
402 integer, dimension(:), optional, intent(in) :: imap
403 integer :: nf90_get_var
404
405 (Replaces ncvgt() in version 2)
406
407 Reads a value or values from a netCDF variable. The netCDF
408 dataset must be open and in data mode. values will receive the
409 value(s) what will be read from the netCDF
410 variable identified by ncid and varid; it may be a scalar or an
411 array and must be of type character, integer(kind=OneByteInt),
412 integer(kind=TwoByteInt), integer(kind=FourByteInt), inte‐
413 ger(kind=EightByteInt), real(kind=FourByteReal), or re‐
414 al(kind=EightByteReal). All values are converted from the ex‐
415 ternal type of the netCDF variable, if possible; otherwise, an
416 nf90_erange error is returned. The optional argument start
417 specifies the starting index in the netCDF variable for reading
418 for each dimension of the netCDF variable. The optional argu‐
419 ment stride specifies the sampling stride (the interval between
420 accessed values in the netCDF variable) for each dimension of
421 the netCDF variable (see COMMON ARGUMENT DESCRIPTIONS below).
422 The optional argument imap specifies the in-memory arrangement
423 of the data values (see COMMON ARGUMENT DESCRIPTIONS below).
424
425 function nf90_inquire_attribute(ncid, varid, name, xtype, len, attnum)
426 integer, intent(in) :: ncid, varid
427 character(len=*), intent(in) :: name
428 integer, optional, intent(out) :: xtype, len, attnum
429 integer :: nf90_inquire_attribute
430
431 Inquires about the netCDF attribute named name, of variable
432 varid, in the open netCDF dataset ncid. xtype will contain the
433 external, netCDF type of the variable. len will contain the
434 number of elements in the attribute. attnum will contain the
435 attribute number.
436
437 function nf90_inq_attname(ncid, varid, attnum, name)
438 integer, intent(in) :: ncid, varid, attnum
439 character(len=*), intent(out) :: name
440 integer :: nf90_inq_attname
441
442 (Corresponds to ncanam() in version 2)
443
444 Gets the name of an attribute, given its variable ID and at‐
445 tribute number. This function is useful in generic applications
446 that need to get the names of all the attributes associated with
447 a variable because attributes are accessed by name rather than
448 number in all other attribute functions (the number of an at‐
449 tribute is more volatile than the name because it can change
450 when other attributes of the same variable are deleted). The
451 attributes for each variable are numbered from 1 (the first at‐
452 tribute) to natts, where natts is the number of attributes for
453 the variable, as returned from a call to nf90_inquire_vari‐
454 able().
455
456 function nf90_put_att(ncid, varid, name, values)
457 integer, intent(in) :: ncid, varid
458 character(len=*), intent(in) :: name
459 <<whatever>>, intent(in) :: values
460 integer :: nf90_put_att
461
462 Unlike variables, attributes do not have separate functions for
463 defining and writing values. This function defines a new at‐
464 tribute with a value or changes the value of an existing at‐
465 tribute. If the attribute is new, or if the space required to
466 store the attribute value is greater than before, the netCDF
467 dataset must be in define mode. values contains the attribute
468 values to be written; it may be a scalar or a vector and must be
469 of type character, integer(kind=OneByteInt), inte‐
470 ger(kind=TwoByteInt), integer(kind=FourByteInt), inte‐
471 ger(kind=EightByteInt), real(kind=FourByteReal), or re‐
472 al(kind=EightByteReal).
473
474 function nf90_get_att(ncid, varid, name, fIvalues)
475 integer, intent(in) :: ncid, varid
476 character(len=*), intent(in) :: name
477 <<whatever>>, intent(out) :: values
478 integer :: nf90_get_att
479
480 (Replaces ncagt() in version 2)
481
482 Gets the value(s) of a netCDF attribute, given its variable ID
483 and name. The values are returned in values, which must be of
484 type character, integer(kind=OneByteInt), inte‐
485 ger(kind=TwoByteInt), integer(kind=FourByteInt), inte‐
486 ger(kind=EightByteInt), real(kind=FourByteReal), or re‐
487 al(kind=EightByteReal). Converts from the external type to the
488 type of the receiving variable, if possible; otherwise returns
489 an nf90_erange error. All values of the attribute are returned,
490 so you must allocate enough space to hold them. If you don't
491 know how much space to reserve, call nf90_inquire_attribute()
492 first to find out the length of the attribute.
493
494 function nf90_copy_att(ncid_in, varid_in, name, ncid_out, varid_out)
495 integer, intent(in) :: ncid_in, varid_in
496 character(len=*), intent(in) :: name
497 integer, intent(in) :: ncid_out, varid_out
498 integer :: nf90_copy_att
499
500 (Corresponds to ncacpy() in version 2)
501
502 Copies an attribute from one netCDF dataset to another. It can
503 also be used to copy an attribute from one variable to another
504 within the same netCDF dataset. ncid_in is the netCDF ID of an
505 input netCDF dataset from which the attribute will be copied.
506 varid_in is the ID of the variable in the input netCDF dataset
507 from which the attribute will be copied, or nf90_global for a
508 global attribute. name is the name of the attribute in the in‐
509 put netCDF dataset to be copied. ncid_out is the netCDF ID of
510 the output netCDF dataset to which the attribute will be copied.
511 It is permissible for the input and output netCDF ID's to be the
512 same. The output netCDF dataset should be in define mode if the
513 attribute to be copied does not already exist for the target
514 variable, or if it would cause an existing target attribute to
515 grow. varid_out is the ID of the variable in the output netCDF
516 dataset to which the attribute will be copied, or nf90_global to
517 copy to a global attribute.
518
519 function nf90_rename_att(ncid, varid, name, newname)
520 integer, intent(in) :: ncid, varid
521 character(len=*), intent(in) :: name, newname
522 integer :: nf90_rename_att
523
524 (Corresponds to ncaren()
525
526 Changes the name of an attribute. If the new name is longer
527 than the original name, the netCDF must be in define mode. You
528 cannot rename an attribute to have the same name as another at‐
529 tribute of the same variable. name is the original attribute
530 name. newname is the new name to be assigned to the specified
531 attribute. If the new name is longer than the old name, the
532 netCDF dataset must be in define mode.
533
534 function nf90_del_att(ncid, varid, name)
535 integer, intent(in) :: ncid, varid
536 character(len=*), intent(in) :: name
537 integer :: nf90_del_att
538
539 (Corresponds to ncadel() in version 2)
540
541 Deletes an attribute from a netCDF dataset. The dataset
542 must be in define mode.
543
545 In this section we define some common arguments which are used in the
546 "FUNCTION DESCRIPTIONS" section.
547
548 integer ncid
549 is the netCDF ID returned from a previous, successful call to
550 nf90_open() or nf90_create()
551
552 character(len=*) name
553 is the name of a dimension, variable, or attribute. It shall
554 begin with an alphabetic character, followed by zero or more al‐
555 phanumeric characters including the underscore (`_') or hyphen
556 (`-'). Case is significant. The maximum allowable number of
557 characters is nf90_max_name. Names that begin with an under‐
558 score (`_') are reserved for use by the netCDF interface.
559
560 integer xtype
561 specifies the external data type of a netCDF variable or at‐
562 tribute and is one of the following: nf90_byte, nf90_char,
563 nf90_short, nf90_int, nf90_float, or nf90_double. These are
564 used to specify 8-bit integers, characters, 16-bit integers,
565 32-bit integers, 32-bit IEEE floating point numbers, and 64-bit
566 IEEE floating-point numbers, respectively.
567
568
569 integer dimids
570 is a vector of dimension ID's and defines the shape of a netCDF
571 variable. The size of the vector shall be greater than or equal
572 to the rank (i.e. the number of dimensions) of the variable
573 (ndims). The vector shall be ordered by the speed with which a
574 dimension varies: dimids(1) shall be the dimension ID of the
575 most rapidly varying dimension and dimids(ndims) shall be the
576 dimension ID of the most slowly varying dimension. The maximum
577 possible number of dimensions for a variable is given by the
578 symbolic constant nf90_max_var_dims.
579
580 integer dimid
581 is the ID of a netCDF dimension. netCDF dimension ID's are al‐
582 located sequentially from the positive integers beginning with
583 1.
584
585 integer ndims
586 is either the total number of dimensions in a netCDF dataset or
587 the rank (i.e. the number of dimensions) of a netCDF variable.
588 The value shall not be negative or greater than the symbolic
589 constant nf90_max_var_dims.
590
591 integer varid
592 is the ID of a netCDF variable or (for the attribute-access
593 functions) the symbolic constant nf90_global, which is used to
594 reference global attributes. netCDF variable ID's are allocated
595 sequentially from the positive integers beginning with 1.
596
597 integer natts
598 is the number of global attributes in a netCDF dataset for the
599 nf90_inquire() function or the number of attributes associated
600 with a netCDF variable for the nf90_varinq() function.
601
602 integer start
603 specifies the starting point for accessing a netCDF variable's
604 data values in terms of the indicial coordinates of the corner
605 of the array section. The indices start at 1; thus, the first
606 data value of a variable is (1, 1, ..., 1). The size of the
607 vector shall be at least the rank of the associated netCDF vari‐
608 able and its elements shall correspond, in order, to the vari‐
609 able's dimensions.
610
611 integer stride
612 specifies the sampling interval along each dimension of the
613 netCDF variable. The elements of the stride vector correspond,
614 in order, to the netCDF variable's dimensions (stride(1)) gives
615 the sampling interval along the most rapidly varying dimension
616 of the netCDF variable). Sampling intervals are specified in
617 type-independent units of elements (a value of 1 selects consec‐
618 utive elements of the netCDF variable along the corresponding
619 dimension, a value of 2 selects every other element, etc.).
620
621
622 imap specifies the mapping between the dimensions of a netCDF vari‐
623 able and the in-memory structure of the internal data array.
624 The elements of the index mapping vector correspond, in order,
625 to the netCDF variable's dimensions (imap(1) gives the distance
626 between elements of the internal array corresponding to the most
627 rapidly varying dimension of the netCDF variable). Distances
628 between elements are specified in type-independent units of ele‐
629 ments (the distance between internal elements that occupy adja‐
630 cent memory locations is 1 and not the element's byte-length as
631 in netCDF 2).
632
633
635 By default, the netCDF interface sets the values of all newly-defined
636 variables of finite length (i.e. those that do not have an unlimited,
637 dimension) to the type-dependent fill-value associated with each vari‐
638 able. This is done when nf90_enddef() is called. The fill-value for a
639 variable may be changed from the default value by defining the at‐
640 tribute `_FillValue' for the variable. This attribute must have the
641 same type as the variable and be of length one.
642
643 Variables with an unlimited dimension are also prefilled, but on an `as
644 needed' basis. For example, if the first write of such a variable is
645 to position 5, then positions 1 through 4 (and no others) would be set
646 to the fill-value at the same time.
647
648 This default prefilling of data values may be disabled by or'ing the
649 nf90_nofill flag into the mode parameter of nf90_open() or nf90_cre‐
650 ate(), or, by calling the function nf90_set_fill() with the argument
651 nf90_nofill. For variables that do not use the unlimited dimension,
652 this call must be made before nf90_enddef(). For variables that use
653 the unlimited dimension, this call may be made at any time.
654
655 One can obtain increased performance of the netCDF interface by using
656 this feature, but only at the expense of requiring the application to
657 set every single data value. The performance enhancing behavior of
658 this function is dependent on the particulars of the implementation and
659 dataset format. The flag value controlled by nf90_set_fill() is per
660 netCDF ID, not per variable or per write. Allowing this to change af‐
661 fects the degree to which a program can be effectively parallelized.
662 Given all of this, we state that the use of this feature may not be
663 available (or even needed) in future releases. Programmers are cau‐
664 tioned against heavy reliance upon this feature.
665
667 Additional functions for use on SGI/Cray MPP machines (_CRAYMPP).
668 These are used to set and inquire which PE is the base for MPP for a
669 particular netCDF. These are only relevant when using the SGI/Cray
670 ``global'' Flexible File I/O layer and desire to have only a subset of
671 PEs to open the specific netCDF file. For technical reasons, these
672 functions are available on all platforms. On a platform other than
673 SGI/Cray MPP, it is as if only processor available were processor 0.
674
675 To use this feature, you need to specify a communicator group and call
676 glio_group_mpi() or glio_group_shmem() prior to the netCDF nf90_open()
677 and nf90_create() calls.
678
679 Note that the routines described below are Fortran-77 routines rather
680 than Fortran-90 routines (they have an "nf_" prefix rather than an
681 "nf90_" prefix).
682
683 integer function nf__create_mp(character*(*) path, integer cmode, inte‐
684 ger initialsize, integer pe, integer chunksize, integer ncid)
685
686 Like nf__create() but allows the base PE to be set.
687
688 The argument pe sets the base PE at creation time. In the MPP
689 environment, nf__create() and nf90_create() set the base PE to
690 processor zero by default.
691
692 integer function nf__open_mp(character*(*) path, integer mode, integer
693 pe, integer chunksize, integer ncid)
694
695 Like nf__open() but allows the base PE to be set. The argument
696 pe sets the base PE at creation time. In the MPP environment,
697 nf__open() and nf90_open() set the base PE to processor zero by
698 default.
699
700 integer function nf_inq_base_pe(integer ncid, integer pe)
701
702 Inquires of the netCDF dataset which PE is being used as the
703 base for MPP use. This is safe to use at any time.
704
705 integer function nf_set_base_pe(integer ncid, integer pe)
706
707 Resets the base PE for the netCDF dataset. Only perform this
708 operation when the affected communicator group synchronizes be‐
709 fore and after the call. This operation is very risky and
710 should only be contemplated under only the most extreme cases.
711
713 NETCDF_FFIOSPEC
714 Specifies the Flexible File I/O buffers for netCDF I/O when execut‐
715 ing under the UNICOS operating system (the variable is ignored on
716 other operating systems). An appropriate specification can greatly
717 increase the efficiency of netCDF I/O -- to the extent that it can
718 actually surpass FORTRAN binary I/O. This environment variable has
719 been made a little more generalized, such that other FFIO option
720 specifications can now be added. The default specification is bu‐
721 fa:336:2, unless a current FFIO specification is in operation,
722 which will be honored. See UNICOS Flexible File I/O for more in‐
723 formation.
724
726 Both a mailing list and a digest are available for discussion of the
727 netCDF interface and announcements about netCDF bugs, fixes, and en‐
728 hancements. To begin or change your subscription to either the mail‐
729 ing-list or the digest, send one of the following in the body (not the
730 subject line) of an email message to "majordomo@unidata.ucar.edu". Use
731 your email address in place of jdoe@host.inst.domain.
732
733 To subscribe to the netCDF mailing list:
734 subscribe netcdfgroup jdoe@host.inst.domain
735 To unsubscribe from the netCDF mailing list:
736 unsubscribe netcdfgroup jdoe@host.inst.domain
737 To subscribe to the netCDF digest:
738 subscribe netcdfdigest jdoe@host.inst.domain
739 To unsubscribe from the netCDF digest:
740 unsubscribe netcdfdigest jdoe@host.inst.domain
741 To retrieve the general introductory information for the mailing list:
742 info netcdfgroup
743 To get a synopsis of other majordomo commands:
744 help
745
747 ncdump(1), ncgen(1), netcdf(3f).
748
749 netCDF User's Guide, published by the Unidata Program Center, Universi‐
750 ty Corporation for Atmospheric Research, located in Boulder, Colorado.
751
752
753
754Printed: 119.6.22 2000-04-04 NETCDF(3f90)