1NETCDF(3)                  UNIDATA LIBRARY FUNCTIONS                 NETCDF(3)
2
3
4

NAME

6       netcdf - Unidata's Network Common Data Form (netCDF) library interface
7

SYNOPSIS

9       include netcdf.inc
10
11
12   Most Systems:
13       f77 ...  -lnetcdf -lhdf5_hl -lhdf5 -lz -lm
14
15
16   CRAY PVP Systems:
17       f90 -dp -i64 ... -lnetcdf
18
19       Complete  documentation  for  the  netCDF libraries can be found at the
20       netCDF website: http://www.unidata.ucar.edu/software/netcdf/.
21
22

LIBRARY VERSION

24       This document describes versions 3 and 4 of Unidata netCDF  data-access
25       interface for the FORTRAN programming language.
26
27       character*80 nf_inq_libvers(void)
28
29              Returns  a string identifying the version of the netCDF library,
30              and when it was built, like: "3.1a of Aug 22 1996 12:57:47 $".
31
32       The RCS ident(1) command will find a string like "$Id: @(#) netcdf  li‐
33       brary  version 3.1a of Sep  6 1996 15:56:26 $" in the library. The SCCS
34       what(1) command will find a string like "netcdf library version 3.1a of
35       Aug 23 1996 16:07:40 $".
36

RETURN VALUES

38       All netCDF functions (except nf_inq_libvers() and nf_strerror()) return
39       an integer status.
40
41       If this returned status value is not equal to NF_NOERR (zero), it indi‐
42       cates that an error occurred. The possible status values are defined in
43       netcdf.inc.
44
45       character*80 nf_strerror(integer status)
46
47              Returns a string textual translation of the status  value,  like
48              "Attribute  or variable name contains illegal characters" or "No
49              such file or directory".
50
51

FILE OPERATIONS

53       integer function nf_create(character*(*) path, integer  cmode,  integer
54              ncid)
55
56              Creates  a  new netCDF dataset at path, returning a netCDF ID in
57              ncid.  The argument cmode may include the bitwise-or of the fol‐
58              lowing flags: NF_NOCLOBBER to protect existing datasets (default
59              silently blows them away), NF_SHARE for synchronous dataset  up‐
60              dates for classic format files (default is to buffer accesses),
61
62              When  a  netCDF  dataset is created, is is opened NF_WRITE.  The
63              new netCDF dataset is in define mode.  NF_64BIT_OFFSET.  to cre‐
64              ate  a  file  in the 64-bit offset format (as opposed to classic
65              format, the default).  NF_TRUE to create a  netCDF-4/HDF5  file,
66              and NF_CLASSIC_MODEL to guarantee that netCDF-4/HDF5 files main‐
67              tain compatibility with the netCDF classic data model.
68
69       integer function nf__create(character*(*) path, integer cmode,  integer
70              initialsize, integer chunksize, integer ncid)
71
72              Like  nf_create()  but has additional performance tuning parame‐
73              ters.
74
75              The argument initialsize sets the initial size of  the  file  at
76              creation time.
77
78              See nf__open() below for an explanation of the chunksize parame‐
79              ter.
80
81       integer function  nf_open(character*(*)  path,  integer  mode,  integer
82              ncid)
83
84              (Corresponds to ncopn() in version 2)
85
86              Opens a existing netCDF dataset at path returning a netCDF ID in
87              ncid.  The type of access is described by  the  mode  parameter,
88              which  may  include  the  bitwise-or  of  the  following  flags:
89              NF_WRITE for read-write access (default read-only), NF_SHARE for
90              synchronous dataset updates (default is to buffer accesses), and
91              NF_LOCK (not yet implemented).
92
93              As of NetCDF version 4.1, and if TRUE support was  enabled  when
94              the  NetCDF  library was built, the path parameter may specify a
95              TRUE URL. In this case, the access mode is forced to be read-on‐
96              ly.
97
98       integer  function  nf__open(character*(*)  path,  integer mode, integer
99              chunksize, integer ncid)
100
101              Like nf_open() but has an additional performance tuning  parame‐
102              ter.
103
104              The  argument  referenced  by  chunksize controls a space versus
105              time tradeoff, memory allocated in  the  netcdf  library  versus
106              number  of  system calls.  Because of internal requirements, the
107              value may not be set to exactly the value requested.  The actual
108              value chosen is returned by reference.  Using the value NF_SIZE‐
109              HINT_DEFAULT causes the library to choose a  default.   How  the
110              system  choses  the default depends on the system.  On many sys‐
111              tems, the "preferred I/O  block  size"  is  available  from  the
112              stat()  system  call, struct stat member st_blksize.  If this is
113              available it is used. Lacking that, twice the system pagesize is
114              used.   Lacking  a call to discover the system pagesize, we just
115              set default chunksize to 8192.
116
117              The chunksize is a property of a given  open  netcdf  descriptor
118              ncid, it is not a persistent property of the netcdf dataset.
119
120              As  with  nf__open(), the path parameter may specify a TRUE URL,
121              but the tuning parameters are ignored.
122
123       integer function nf_redef(integer ncid)
124
125              (Corresponds to ncredf() in version 2)
126
127              Puts an open netCDF dataset into  define  mode,  so  dimensions,
128              variables, and attributes can be added or renamed and attributes
129              can be deleted.
130
131       integer function nf_enddef(integer ncid)
132
133              (Corresponds to ncendf() in version 2)
134
135              Takes an open netCDF dataset out of define  mode.   The  changes
136              made  to  the  netCDF  dataset  while  it was in define mode are
137              checked and committed to disk if no problems occurred.  Some da‐
138              ta  values may be written as well, see "VARIABLE PREFILLING" be‐
139              low.  After a successful call, variable  data  can  be  read  or
140              written to the dataset.
141
142       integer  function  nf__enddef(integer  ncid, integer h_minfree, integer
143              v_align, integer v_minfree, integer r_align)
144
145              Like nf_enddef() but has additional performance  tuning  parame‐
146              ters.
147
148              Caution: this function exposes internals of the netcdf version 1
149              file format.  It may not be available on future netcdf implemen‐
150              tations.
151
152              The  current netcdf file format has three sections, the "header"
153              section, the data section for fixed size variables, and the data
154              section  for variables which have an unlimited dimension (record
155              variables).  The header begins at the beginning of the file. The
156              index  (offset)  of  the  beginning of the other two sections is
157              contained in the header. Typically, there is  no  space  between
158              the  sections.  This  causes  copying  overhead to accrue if one
159              wishes to change the size of the sections, as  may  happen  when
160              changing  names  of  things,  text  attribute values, adding at‐
161              tributes or adding variables. Also, for buffered i/o, there  may
162              be advantages to aligning sections in certain ways.
163
164              The  minfree  parameters  allow  one  to control costs of future
165              calls to nf_redef(),  nf_enddef()  by  requesting  that  minfree
166              bytes be available at the end of the section.  The h_minfree pa‐
167              rameter sets the pad at the end of  the  "header"  section.  The
168              v_minfree  parameter sets the pad at the end of the data section
169              for fixed size variables.
170
171              The align parameters allow one to set the alignment of  the  be‐
172              ginning of the corresponding sections. The beginning of the sec‐
173              tion is rounded up to an index which is a multiple of the  align
174              parameter.  The  flag  value NF_ALIGN_CHUNK tells the library to
175              use the chunksize (see  above)  as  the  align  parameter.   The
176              v_align parameter controls the alignment of the beginning of the
177              data section for fixed size variables.   The  r_align  parameter
178              controls  the alignment of the beginning of the data section for
179              variables which have an unlimited dimension (record variables).
180
181              The file format requires mod 4 alignment, so the  align  parame‐
182              ters  are silently rounded up to multiples of 4. The usual call,
183              nf_enddef(ncid) is equivalent to nf__enddef(ncid, 0, 4, 0, 4).
184
185              The file format does not contain a "record size" value, this  is
186              calculated from the sizes of the record variables. This unfortu‐
187              nate fact prevents us from providing minfree and alignment  con‐
188              trol  of  the  "records" in a netcdf file. If you add a variable
189              which has an unlimited dimension, the third section will  always
190              be copied with the new variable added.
191
192       integer function nf_sync(integer ncid)
193
194              (Corresponds to ncsnc() in version 2)
195
196              Unless  the NF_SHARE bit is set in nf_open() or nf_create(), ac‐
197              cesses to the underlying netCDF dataset are buffered by the  li‐
198              brary.  This  function  synchronizes the state of the underlying
199              dataset  and  the  library.   This  is  done  automatically   by
200              nf_close() and nf_enddef().
201
202       integer function nf_abort(integer ncid)
203
204              (Corresponds to ncabor() in version 2)
205
206              You  don't  need to call this function.  This function is called
207              automatically by nf_close() if the netCDF was in define mode and
208              something  goes  wrong  with  the commit.  If the netCDF dataset
209              isn't in define  mode,  then  this  function  is  equivalent  to
210              nf_close().   If  it  is  called  after  nf_redef(),  but before
211              nf_enddef(), the new  definitions  are  not  committed  and  the
212              dataset is closed.  If it is called after nf_create() but before
213              nf_enddef(), the dataset disappears.
214
215       integer function nf_close(integer ncid)
216
217              (Corresponds to ncclos() in version 2)
218
219              Closes an open netCDF dataset.  If  the  dataset  is  in  define
220              mode,  nf_enddef()  will  be  called  before  closing.   After a
221              dataset is closed, its ID may be reassigned to another dataset.
222
223       integer function nf_inq(integer ncid, integer ndims, integer nvars, in‐
224              teger natts, integer unlimdimid)
225
226       integer function nf_inq_ndims(integer ncid, integer ndims)
227
228       integer function nf_inq_nvars(integer ncid, integer nvars)
229
230       integer function nf_inq_natts(integer ncid, integer natts)
231
232       integer function nf_inq_unlimdim(integer ncid, integer unlimdimid)
233
234       integer function nf_inq_format(integer ncid, integer formatn)
235
236              Use  these  functions  to  find out what is in a netCDF dataset.
237              Upon successful return, ndims will contain  the number of dimen‐
238              sions  defined  for  this netCDF dataset, nvars will contain the
239              number of variables,  natts  will  contain  the  number  of  at‐
240              tributes,  and  unlimdimid  will contain the dimension ID of the
241              unlimited dimension if one exists, or 0 otherwise.  formatn will
242              contain  the  version  number  of  the  dataset <format>, one of
243              NF_FORMAT_CLASSIC,   NF_FORMAT_64BIT,   NF_FORMAT_NETCDF4,    or
244              NF_FORMAT_NETCDF4_CLASSIC.
245
246
247       integer  function  nf_def_dim(integer ncid, character*(*) name, integer
248              len, integer dimid)
249
250              (Corresponds to ncddef() in version 2)
251
252              Adds a new dimension to an open netCDF dataset, which must be in
253              define  mode.   name  is the dimension name.  dimid will contain
254              the dimension ID of the newly created dimension.
255
256

USER DEFINED TYPES

258       Users many define types for a netCDF-4/HDF5 file (unless  the  NF_CLAS‐
259       SIC_MODEL  was  used  when the file was creates). Users may define com‐
260       pound types, variable length  arrays,  enumeration  types,  and  opaque
261       types.
262
263
264
265       integer  function  nf_def_compound(integer  ncid, integer size, charac‐
266              ter*(*) name, integer typeidp)
267
268              Define a compound type.
269
270       integer function nf_insert_compound(integer  ncid,  integer  ,  charac‐
271              ter*(*) name, integer offset, integer field_typeid)
272
273              Insert  an  element  into a compound type. May not be done after
274              type has been used, or after the type has  been  written  by  an
275              enddef.
276
277       integer function nf_insert_array_compound(integer ncid, integer , char‐
278              acter*(*) name, integer offset,  integer  field_typeid,  integer
279              ndims, integer dim_sizes(1))
280
281              Insert an array into a compound type.
282
283       integer  function  nf_inq_type(integer  ncid,  integer  , character*(*)
284              name, integer sizep)
285
286              Learn about a type.
287
288       integer function nf_inq_compound(integer ncid, integer ,  character*(*)
289              name, integer sizep, integer nfieldsp)
290
291       integer  function  nf_inq_compound_name(integer ncid, integer , charac‐
292              ter*(*) name)
293
294       integer function nf_inq_compound_size(integer ncid, integer  ,  integer
295              sizep)
296
297       integer  function nf_inq_compound_nfields(integer ncid, integer , inte‐
298              ger nfieldsp)
299
300       integer function nf_inq_compound_fieldname(integer ncid, integer ,  in‐
301              teger fieldid, character*(*) name)
302
303       integer  function  nf_inq_compound_fieldindex(integer  ncid,  integer ,
304              character*(*) name, integer fieldidp)
305
306       integer function nf_inq_compound_fieldoffset(integer  ncid,  integer  ,
307              integer fieldid, integer offsetp)
308
309       integer  function nf_inq_compound_fieldtype(integer ncid, integer , in‐
310              teger fieldid, integer field_typeid)
311
312       integer function nf_inq_compound_fieldndims(integer ncid, integer , in‐
313              teger fieldid, integer ndims)
314
315       integer function nf_inq_compound_fielddim_sizes(integer ncid, integer ,
316              integer fieldid, integer dim_sizes(1))
317
318              Learn about a compound type.
319
320       integer function nf_def_vlen(integer ncid, character*(*) name,  integer
321              base_typeid, integer xtypep)
322
323              Create a varaible length array type.
324
325       integer  function  nf_inq_vlen(integer  ncid,  integer  , character*(*)
326              name, integer datum_sizep, integer base_nc_typep)
327
328              Learn about a varaible length array type.
329
330       integer function nf_free_vlen(nc_vlen_t *vl)
331
332              Free memory comsumed by reading data of a varaible length  array
333              type.
334
335       integer  function  nf_put_vlen_element(integer  ncid,  integer , void *
336              vlen_element, integer len, void * data)
337
338              Write one VLEN.
339
340       integer function nf_get_vlen_element(integer ncid,  integer  ,  void  *
341              vlen_element, integer len, void * data)
342
343              Read one VLEN.
344
345       integer function nf_free_string(integer len, char **data)
346
347              Free memory comsumed by reading data of a string type.
348
349       integer function nf_inq_user_type(integer ncid, integer , character*(*)
350              name, integer , integer , integer , integer )
351
352              Learn about a user define type.
353
354       integer function nf_def_enum(integer ncid, integer base_typeid, charac‐
355              ter*(*) name, integer typeidp)
356
357              Define an enumeration type.
358
359       integer  function  nf_insert_enum(integer  ncid,  integer  base_typeid,
360              character*(*) name, const void *value)
361
362              Insert a name-value pair into enumeration type.
363
364       integer function nf_inq_enum_member(integer ncid, integer xtype,  inte‐
365              ger idx, character*(*) name, void *value)
366
367       integer function nf_inq_enum_ident(integer ncid, integer xtype, integer
368              idx, integer*8 value, character*(*) identifier)
369
370              Learn about a name-value pair into enumeration type.
371
372       integer function  nf_def_opaque(integer  ncid,  integer  size,  charac‐
373              ter*(*) name, integer xtypep)
374
375              Create an opaque type.
376
377       integer  function  nf_inq_opaque(integer  ncid,  integer xtype, charac‐
378              ter*(*) name, integer sizep)
379
380              Learn about opaque type.
381
382
383

GROUPS

385       Users may organize data into hierarchical groups in netCDF-4/HDF5 files
386       (unless NF_CLASSIC_MODEL was used when creating the file).
387
388       integer  function  nf_inq_grps(integer  ncid,  integer numgrps, integer
389              ncids(1))
390
391              Learn how many groups (and their ncids) are available  from  the
392              group represented by ncid.
393
394       integer function nf_inq_grpname(integer ncid, character*(*) name)
395
396       integer function nf_inq_grpname_full(integer ncid, integer len, charac‐
397              ter*(*) name)
398
399       integer function nf_inq_grpname_len(integer ncid, integer len)
400
401       integer function nf_inq_grp_parent(integer ncid, integer ncid)
402
403       integer function nf_inq_grp_ncid(integer ncid, character*(*) name,  in‐
404              teger ncid)
405
406       integer function nf_inq_full_ncid(integer ncid, character*(*) name, in‐
407              teger ncid)
408
409              Learn about a group.
410
411       integer function nf_inq_varids(integer ncid, integer nvars, integer )
412
413              Get the varids in a group.
414
415       integer function nf_inq_dimids(integer  ncid,  integer  ndims,  integer
416              dimids, integer include_parents)
417
418              Get the dimids in a group and (potentially) its parents.
419
420       integer  function  nf_inq_typeids(integer ncid, integer ntypes, integer
421              typeids(1))
422
423              Get the typeids of user-defined types in a group.
424
425       integer function nf_def_grp(integer ncid, character*(*)  name,  integer
426              ncid)
427
428              Create a group.
429

DIMENSIONS

431       integer function nf_inq_dimid(integer ncid, character*(*) name, integer
432              dimid)
433
434              (Corresponds to ncdid() in version 2)
435
436              Given a dimension name, returns the ID of a netCDF dimension  in
437              dimid.
438
439       integer  function nf_inq_dim(integer ncid, integer dimid, character*(*)
440              name, integer len)
441
442       integer function nf_inq_dimname(integer ncid,  integer  dimid,  charac‐
443              ter*(*) name)
444
445       integer  function  nf_inq_dimlen(integer  ncid,  integer dimid, integer
446              len)
447
448              Use these functions to find out about a dimension.
449
450              name should be  big enough (NF_MAX_NAME) to hold  the  dimension
451              name  as  the name will be copied into your storage.  The length
452              return parameter, len will contain the size  of  the  dimension.
453              For  the unlimited dimension, the returned length is the current
454              maximum value used for writing into any of the  variables  which
455              use the dimension.
456
457       integer  function  nf_rename_dim(integer  ncid,  integer dimid, charac‐
458              ter*(*) name)
459
460              (Corresponds to ncdren() in version 2)
461
462              Renames an existing dimension in an open netCDF dataset.  If the
463              new name is longer than the old name, the netCDF dataset must be
464              in define mode.  You cannot rename a dimension to have the  same
465              name as another dimension.
466

VARIABLES

468       integer  function  nf_def_var(integer ncid, character*(*) name, integer
469              xtype, integer ndims, integer dimids(1), integer varid)
470
471              (Corresponds to ncvdef() in version 2)
472
473              Adds a new variable to a netCDF dataset. The netCDF must  be  in
474              define mode.  varid will be set to the netCDF variable ID.
475
476       integer function nf_inq_varid(integer ncid, character*(*) name, integer
477              varid)
478
479              (Corresponds to ncvid() in version 2)
480
481              Returns the ID of a netCDF variable in varid given its name.
482
483       integer function nf_inq_var(integer ncid, integer varid,  character*(*)
484              name,  integer  xtype, integer ndims, integer dimids(1), integer
485              natts)
486
487       integer function nf_inq_varname(integer ncid,  integer  varid,  charac‐
488              ter*(*) name)
489
490       integer  function  nf_inq_vartype(integer  ncid, integer varid, integer
491              xtype)
492
493       integer function nf_inq_varndims(integer ncid, integer  varid,  integer
494              ndims)
495
496       integer  function  nf_inq_vardimid(integer ncid, integer varid, integer
497              dimids(1))
498
499       integer function nf_inq_varnatts(integer ncid, integer  varid,  integer
500              natts)
501
502              Returns information about a netCDF variable, given its ID.
503
504
505       integer  function  nf_rename_var(integer  ncid,  integer varid, charac‐
506              ter*(*) name)
507
508              (Corresponds to ncvren() in version 2)
509
510              Changes the name of a netCDF  variable.   If  the  new  name  is
511              longer  than  the  old  name, the netCDF must be in define mode.
512              You cannot rename a variable to have the name  of  any  existing
513              variable.
514
515

VARIABLES in NETCDF-4 FILES

517       The   following   functions   may  only  be  used  on  variables  in  a
518       netCDF-4/HDF5 data file. These functions must be called after the vari‐
519       able is defined, but before an enddef call.
520
521       integer  function nf_def_var_deflate(integer ncid, integer varid, inte‐
522       ger shuffle, integer deflate, integer deflate_level)
523
524       Turn on compression and/or shuffle filter. (Shuffle filter is only use‐
525       ful for integer data.)
526
527       integer  function nf_inq_var_deflate(integer ncid, integer varid, inte‐
528              ger shufflep, integer deflatep, integer deflate_levelp)
529
530              Learn about a variable's deflate settings.
531
532       integer function nf_def_var_fletcher32(integer ncid, integer varid, in‐
533              teger fletcher32)
534
535              Turn on checksumming for a variable.
536
537       integer function nf_inq_var_fletcher32(integer ncid, integer varid, in‐
538              teger fletcher32)
539
540              Learn about checksumming for a variable.
541
542       integer function nf_def_var_chunking(integer ncid, integer varid, inte‐
543              ger storage, integer chunksizesp(1))
544
545              Set chunksizes for a variable.
546
547       integer function nf_inq_var_chunking(integer ncid, integer varid, inte‐
548              ger storagep, integer chunksizesp(1))
549
550              Learn about chunksizes for a variable.
551
552       integer function nf_def_var_fill(integer ncid, integer  varid,  integer
553              no_fill, integer chunksizesp(1))
554
555              Set a fill value for a variable.
556
557       integer  function  nf_inq_var_fill(integer ncid, integer varid, integer
558              storagep, integer chunksizesp(1))
559
560              Learn the fill value for a variable.
561
562       integer function nf_def_var_endian(integer ncid, integer varid, integer
563              endian)
564
565              Set endianness of variable.
566
567       integer function nf_inq_var_endian(integer ncid, integer varid, integer
568              endianp)
569
570              Learn the endianness of a variable.
571
572
573
574

WRITING AND READING WHOLE VARIABLES

576       integer function nf_put_var_text(integer ncid, integer  varid,  charac‐
577              ter*(*) out)
578
579
580       integer function nf_put_var_int1(integer ncid, integer varid, integer*1
581              out(1))
582
583       integer function nf_put_var_int2(integer ncid, integer varid, integer*2
584              out(1))
585
586       integer  function  nf_put_var_int(integer  ncid, integer varid, integer
587              out(1))
588
589
590       integer function  nf_put_var_real(integer  ncid,  integer  varid,  real
591              out(1))
592
593       integer function nf_put_var_double(integer ncid, integer varid, double‐
594              precision out(1))
595
596       integer function nf_put_var_ubyte(integer ncid,  integer  varid,  inte‐
597              ger*1 out(1))
598
599       integer  function  nf_put_var_ushort(integer ncid, integer varid, inte‐
600              ger*2 out(1))
601
602       integer function nf_put_var_uint(integer ncid, integer varid, integer*4
603              out(1))
604
605       integer  function  nf_put_var_(integer  ncid,  integer varid, integer*8
606              out(1))
607
608       integer function nf_put_var_uint64(integer ncid, integer  varid,  inte‐
609              ger*8 out(1))
610
611       integer function nf_put_var_string(integer ncid, integer varid, charac‐
612              ter* out(1))
613
614
615
616              Writes an entire netCDF variable (i.e.  all  the  values).   The
617              netCDF  dataset  must be open and in data mode.  The type of the
618              data is specified in the function name, and it is  converted  to
619              the external type of the specified variable, if possible, other‐
620              wise an NF_ERANGE error is returned. Note that rounding  is  not
621              performed  during  the  conversion.  Floating  point numbers are
622              truncated when converted to integers.
623
624       integer function nf_get_var_text(integer ncid, integer  varid,  charac‐
625              ter*(*) in)
626
627
628       integer function nf_get_var_int1(integer ncid, integer varid, integer*1
629              in(1))
630
631       integer function nf_get_var_int2(integer ncid, integer varid, integer*2
632              in(1))
633
634       integer  function  nf_get_var_int(integer  ncid, integer varid, integer
635              in(1))
636
637
638       integer function  nf_get_var_real(integer  ncid,  integer  varid,  real
639              in(1))
640
641       integer function nf_get_var_double(integer ncid, integer varid, double‐
642              precision in(1))
643
644       integer function nf_get_var_ubyte(integer ncid,  integer  varid,  inte‐
645              ger*1 in(1))
646
647       integer  function  nf_get_var_ushort(integer ncid, integer varid, inte‐
648              ger*2 in(1))
649
650       integer function nf_get_var_uint(integer ncid, integer varid, integer*4
651              in(1))
652
653       integer  function  nf_get_var_(integer  ncid,  integer varid, integer*8
654              in(1))
655
656       integer function nf_get_var_uint64(integer ncid, integer  varid,  inte‐
657              ger*8 in(1))
658
659       integer function nf_get_var_string(integer ncid, integer varid, charac‐
660              ter* in(1))
661
662
663
664              Reads an entire netCDF variable  (i.e.  all  the  values).   The
665              netCDF  dataset must be open and in data mode.  The data is con‐
666              verted from the external type of the specified variable, if nec‐
667              essary,  to the type specified in the function name.  If conver‐
668              sion is not possible, an NF_ERANGE error is returned.
669

WRITING AND READING ONE DATUM

671       integer function nf_put_var1_text(integer ncid, integer varid,  integer
672              index(1), character*1 *out)
673
674
675       integer  function nf_put_var1_int1(integer ncid, integer varid, integer
676              index(1), integer*1 *out)
677
678       integer function nf_put_var1_int2(integer ncid, integer varid,  integer
679              index(1), integer*2 *out)
680
681       integer  function  nf_put_var1_int(integer ncid, integer varid, integer
682              index(1), integer *out)
683
684
685       integer function nf_put_var1_real(integer ncid, integer varid,  integer
686              index(1), real *out)
687
688       integer  function nf_put_var1_double(integer ncid, integer varid, inte‐
689              ger index(1), doubleprecision *out)
690
691       integer function nf_put_var1_ubyte(integer ncid, integer varid, integer
692              index(1), integer*1 *out)
693
694       integer  function nf_put_var1_ushort(integer ncid, integer varid, inte‐
695              ger index(1), integer*2 *out)
696
697       integer function nf_put_var1_uint(integer ncid, integer varid,  integer
698              index(1), integer*4 *out)
699
700       integer  function nf_put_var1_(integer ncid, integer varid, integer in‐
701              dex(1), integer*8 *out)
702
703       integer function nf_put_var1_uint64(integer ncid, integer varid,  inte‐
704              ger index(1), integer*8 *out)
705
706       integer  function nf_put_var1_string(integer ncid, integer varid, inte‐
707              ger index(1), character* *out)
708
709
710
711              Puts a single data value into a variable at the  position  index
712              of an open netCDF dataset that is in data mode.  The type of the
713              data is specified in the function name, and it is  converted  to
714              the external type of the specified variable, if possible, other‐
715              wise an NF_ERANGE error is returned.
716
717       integer function nf_get_var1_text(integer ncid, integer varid,  integer
718              index(1), character*1 in)
719
720
721       integer  function nf_get_var1_int1(integer ncid, integer varid, integer
722              index(1), integer*1 in)
723
724       integer function nf_get_var1_int2(integer ncid, integer varid,  integer
725              index(1), integer*2 in)
726
727       integer  function  nf_get_var1_int(integer ncid, integer varid, integer
728              index(1), integer in)
729
730
731       integer function nf_get_var1_real(integer ncid, integer varid,  integer
732              index(1), real in)
733
734       integer  function nf_get_var1_double(integer ncid, integer varid, inte‐
735              ger index(1), doubleprecision in)
736
737       integer function nf_get_var1_ubyte(integer ncid, integer varid, integer
738              index(1), integer*1 in)
739
740       integer  function nf_get_var1_ushort(integer ncid, integer varid, inte‐
741              ger index(1), integer*2 in)
742
743       integer function nf_get_var1_uint(integer ncid, integer varid,  integer
744              index(1), integer*4 in)
745
746       integer  function nf_get_var1_(integer ncid, integer varid, integer in‐
747              dex(1), integer*8 in)
748
749       integer function nf_get_var1_uint64(integer ncid, integer varid,  inte‐
750              ger index(1), integer*8 in)
751
752       integer  function nf_get_var1_string(integer ncid, integer varid, inte‐
753              ger index(1), character* in)
754
755
756
757              Gets a single data value from a variable at the  position  index
758              of  an  open  netCDF  dataset that is in data mode.  The data is
759              converted from the external type of the specified  variable,  if
760              necessary,  to the type specified in the function name.  If con‐
761              version is not possible, an NF_ERANGE error is returned.
762

WRITING AND READING AN ARRAY

764       integer function nf_put_vara_text(integer ncid, integer varid,  integer
765              start(1), integer count(1), character*(*) out)
766
767
768       integer  function nf_put_vara_int1(integer ncid, integer varid, integer
769              start(1), integer count(1), integer*1 out(1))
770
771       integer function nf_put_vara_int2(integer ncid, integer varid,  integer
772              start(1), integer count(1), integer*2 out(1))
773
774       integer  function  nf_put_vara_int(integer ncid, integer varid, integer
775              start(1), integer count(1), integer out(1))
776
777
778       integer function nf_put_vara_real(integer ncid, integer varid,  integer
779              start(1), integer count(1), real out(1))
780
781       integer  function nf_put_vara_double(integer ncid, integer varid, inte‐
782              ger start(1), integer count(1), doubleprecision out(1))
783
784       integer function nf_put_vara_ubyte(integer ncid, integer varid, integer
785              start(1), integer count(1), integer*1 out(1))
786
787       integer  function nf_put_vara_ushort(integer ncid, integer varid, inte‐
788              ger start(1), integer count(1), integer*2 out(1))
789
790       integer function nf_put_vara_uint(integer ncid, integer varid,  integer
791              start(1), integer count(1), integer*4 out(1))
792
793       integer  function  nf_put_vara_(integer  ncid,  integer  varid, integer
794              start(1), integer count(1), integer*8 out(1))
795
796       integer function nf_put_vara_uint64(integer ncid, integer varid,  inte‐
797              ger start(1), integer count(1), integer*8 out(1))
798
799       integer  function nf_put_vara_string(integer ncid, integer varid, inte‐
800              ger start(1), integer count(1), character* out(1))
801
802
803
804              Writes an array section of values into a netCDF variable  of  an
805              open netCDF dataset, which must be in data mode.  The array sec‐
806              tion is specified by the start and count vectors, which give the
807              starting  index  and count of values along each dimension of the
808              specified variable.  The type of the data is  specified  in  the
809              function name and is converted to the external type of the spec‐
810              ified variable, if possible, otherwise an NF_ERANGE error is re‐
811              turned.
812
813       integer  function nf_get_vara_text(integer ncid, integer varid, integer
814              start(1), integer count(1), character*(*) in)
815
816
817       integer function nf_get_vara_int1(integer ncid, integer varid,  integer
818              start(1), integer count(1), integer*1 in(1))
819
820       integer  function nf_get_vara_int2(integer ncid, integer varid, integer
821              start(1), integer count(1), integer*2 in(1))
822
823       integer function nf_get_vara_int(integer ncid, integer  varid,  integer
824              start(1), integer count(1), integer in(1))
825
826
827       integer  function nf_get_vara_real(integer ncid, integer varid, integer
828              start(1), integer count(1), real in(1))
829
830       integer function nf_get_vara_double(integer ncid, integer varid,  inte‐
831              ger start(1), integer count(1), doubleprecision in(1))
832
833       integer function nf_get_vara_ubyte(integer ncid, integer varid, integer
834              start(1), integer count(1), integer*1 in(1))
835
836       integer function nf_get_vara_ushort(integer ncid, integer varid,  inte‐
837              ger start(1), integer count(1), integer*2 in(1))
838
839       integer  function nf_get_vara_uint(integer ncid, integer varid, integer
840              start(1), integer count(1), integer*4 in(1))
841
842       integer function  nf_get_vara_(integer  ncid,  integer  varid,  integer
843              start(1), integer count(1), integer*8 in(1))
844
845       integer  function nf_get_vara_uint64(integer ncid, integer varid, inte‐
846              ger start(1), integer count(1), integer*8 in(1))
847
848       integer function nf_get_vara_string(integer ncid, integer varid,  inte‐
849              ger start(1), integer count(1), character* in(1))
850
851
852
853              Reads  an  array  section of values from a netCDF variable of an
854              open netCDF dataset, which must be in data mode.  The array sec‐
855              tion is specified by the start and count vectors, which give the
856              starting index and count of values along each dimension  of  the
857              specified  variable.   The  data  is converted from the external
858              type of the specified variable, if necessary, to the type speci‐
859              fied  in  the  function name.  If conversion is not possible, an
860              NF_ERANGE error is returned.
861

WRITING AND READING A SLICED ARRAY

863       integer function nf_put_vars_text(integer ncid, integer varid,  integer
864              start(1),  integer  count(1),  integer  stride(1), character*(*)
865              out)
866
867
868       integer function nf_put_vars_int1(integer ncid, integer varid,  integer
869              start(1), integer count(1), integer stride(1), integer*1 out(1))
870
871       integer  function nf_put_vars_int2(integer ncid, integer varid, integer
872              start(1), integer count(1), integer stride(1), integer*2 out(1))
873
874       integer function nf_put_vars_int(integer ncid, integer  varid,  integer
875              start(1), integer count(1), integer stride(1), integer out(1))
876
877
878       integer  function nf_put_vars_real(integer ncid, integer varid, integer
879              start(1), integer count(1), integer stride(1), real out(1))
880
881       integer function nf_put_vars_double(integer ncid, integer varid,  inte‐
882              ger  start(1), integer count(1), integer stride(1), doublepreci‐
883              sion out(1))
884
885       integer function nf_put_vars_ubyte(integer ncid, integer varid, integer
886              start(1), integer count(1), integer stride(1), integer*1 out(1))
887
888       integer  function nf_put_vars_ushort(integer ncid, integer varid, inte‐
889              ger start(1), integer  count(1),  integer  stride(1),  integer*2
890              out(1))
891
892       integer  function nf_put_vars_uint(integer ncid, integer varid, integer
893              start(1), integer count(1), integer stride(1), integer*4 out(1))
894
895       integer function  nf_put_vars_(integer  ncid,  integer  varid,  integer
896              start(1), integer count(1), integer stride(1), integer*8 out(1))
897
898       integer  function nf_put_vars_uint64(integer ncid, integer varid, inte‐
899              ger start(1), integer  count(1),  integer  stride(1),  integer*8
900              out(1))
901
902       integer  function nf_put_vars_string(integer ncid, integer varid, inte‐
903              ger start(1), integer count(1),  integer  stride(1),  character*
904              out(1))
905
906
907
908              These  functions  are used for strided output, which is like the
909              array section output described above, except that  the  sampling
910              stride  (the  interval between accessed values) is specified for
911              each dimension.  For an explanation of the sampling stride  vec‐
912              tor, see COMMON ARGUMENTS DESCRIPTIONS below.
913
914       integer  function nf_get_vars_text(integer ncid, integer varid, integer
915              start(1), integer count(1), integer stride(1), character*(*) in)
916
917
918       integer function nf_get_vars_int1(integer ncid, integer varid,  integer
919              start(1), integer count(1), integer stride(1), integer*1 in(1))
920
921       integer  function nf_get_vars_int2(integer ncid, integer varid, integer
922              start(1), integer count(1), integer stride(1), integer*2 in(1))
923
924       integer function nf_get_vars_int(integer ncid, integer  varid,  integer
925              start(1), integer count(1), integer stride(1), integer in(1))
926
927
928       integer  function nf_get_vars_real(integer ncid, integer varid, integer
929              start(1), integer count(1), integer stride(1), real in(1))
930
931       integer function nf_get_vars_double(integer ncid, integer varid,  inte‐
932              ger  start(1), integer count(1), integer stride(1), doublepreci‐
933              sion in(1))
934
935       integer function nf_get_vars_ubyte(integer ncid, integer varid, integer
936              start(1), integer count(1), integer stride(1), integer*1 in(1))
937
938       integer  function nf_get_vars_ushort(integer ncid, integer varid, inte‐
939              ger start(1), integer  count(1),  integer  stride(1),  integer*2
940              in(1))
941
942       integer  function nf_get_vars_uint(integer ncid, integer varid, integer
943              start(1), integer count(1), integer stride(1), integer*4 in(1))
944
945       integer function  nf_get_vars_(integer  ncid,  integer  varid,  integer
946              start(1), integer count(1), integer stride(1), integer*8 in(1))
947
948       integer  function nf_get_vars_uint64(integer ncid, integer varid, inte‐
949              ger start(1), integer  count(1),  integer  stride(1),  integer*8
950              in(1))
951
952       integer  function nf_get_vars_string(integer ncid, integer varid, inte‐
953              ger start(1), integer count(1),  integer  stride(1),  character*
954              in(1))
955
956
957
958              These  functions  are  used for strided input, which is like the
959              array section input described above, except  that  the  sampling
960              stride  (the  interval between accessed values) is specified for
961              each dimension.  For an explanation of the sampling stride  vec‐
962              tor, see COMMON ARGUMENTS DESCRIPTIONS below.
963

WRITING AND READING A MAPPED ARRAY

965       integer  function nf_put_varm_text(integer ncid, integer varid, integer
966              start(1), integer count(1),  integer  stride(1),  imap,  charac‐
967              ter*(*) out)
968
969
970       integer  function nf_put_varm_int1(integer ncid, integer varid, integer
971              start(1), integer count(1), integer stride(1),  imap,  integer*1
972              out(1))
973
974       integer  function nf_put_varm_int2(integer ncid, integer varid, integer
975              start(1), integer count(1), integer stride(1),  imap,  integer*2
976              out(1))
977
978       integer  function  nf_put_varm_int(integer ncid, integer varid, integer
979              start(1), integer count(1),  integer  stride(1),  imap,  integer
980              out(1))
981
982
983       integer  function nf_put_varm_real(integer ncid, integer varid, integer
984              start(1),  integer  count(1),  integer  stride(1),  imap,   real
985              out(1))
986
987       integer  function nf_put_varm_double(integer ncid, integer varid, inte‐
988              ger start(1), integer count(1), integer stride(1), imap, double‐
989              precision out(1))
990
991       integer function nf_put_varm_ubyte(integer ncid, integer varid, integer
992              start(1), integer count(1), integer stride(1),  imap,  integer*1
993              out(1))
994
995       integer  function nf_put_varm_ushort(integer ncid, integer varid, inte‐
996              ger start(1), integer count(1), integer stride(1),  imap,  inte‐
997              ger*2 out(1))
998
999       integer  function nf_put_varm_uint(integer ncid, integer varid, integer
1000              start(1), integer count(1), integer stride(1),  imap,  integer*4
1001              out(1))
1002
1003       integer  function  nf_put_varm_(integer  ncid,  integer  varid, integer
1004              start(1), integer count(1), integer stride(1),  imap,  integer*8
1005              out(1))
1006
1007       integer  function nf_put_varm_uint64(integer ncid, integer varid, inte‐
1008              ger start(1), integer count(1), integer stride(1),  imap,  inte‐
1009              ger*8 out(1))
1010
1011       integer  function nf_put_varm_string(integer ncid, integer varid, inte‐
1012              ger start(1), integer count(1), integer stride(1), imap, charac‐
1013              ter* out(1))
1014
1015
1016
1017              These functions are used for mapped output, which is like strid‐
1018              ed output described above, except that an additional index  map‐
1019              ping  vector is provided to specify the in-memory arrangement of
1020              the data values.  For an explanation of the index  mapping  vec‐
1021              tor, see COMMON ARGUMENTS DESCRIPTIONS below.
1022
1023       integer  function nf_get_varm_text(integer ncid, integer varid, integer
1024              start(1), integer count(1),  integer  stride(1),  imap,  charac‐
1025              ter*(*) in)
1026
1027
1028       integer  function nf_get_varm_int1(integer ncid, integer varid, integer
1029              start(1), integer count(1), integer stride(1),  imap,  integer*1
1030              in(1))
1031
1032       integer  function nf_get_varm_int2(integer ncid, integer varid, integer
1033              start(1), integer count(1), integer stride(1),  imap,  integer*2
1034              in(1))
1035
1036       integer  function  nf_get_varm_int(integer ncid, integer varid, integer
1037              start(1), integer count(1),  integer  stride(1),  imap,  integer
1038              in(1))
1039
1040
1041       integer  function nf_get_varm_real(integer ncid, integer varid, integer
1042              start(1), integer count(1), integer stride(1), imap, real in(1))
1043
1044       integer function nf_get_varm_double(integer ncid, integer varid,  inte‐
1045              ger start(1), integer count(1), integer stride(1), imap, double‐
1046              precision in(1))
1047
1048       integer function nf_get_varm_ubyte(integer ncid, integer varid, integer
1049              start(1),  integer  count(1), integer stride(1), imap, integer*1
1050              in(1))
1051
1052       integer function nf_get_varm_ushort(integer ncid, integer varid,  inte‐
1053              ger  start(1),  integer count(1), integer stride(1), imap, inte‐
1054              ger*2 in(1))
1055
1056       integer function nf_get_varm_uint(integer ncid, integer varid,  integer
1057              start(1),  integer  count(1), integer stride(1), imap, integer*4
1058              in(1))
1059
1060       integer function  nf_get_varm_(integer  ncid,  integer  varid,  integer
1061              start(1),  integer  count(1), integer stride(1), imap, integer*8
1062              in(1))
1063
1064       integer function nf_get_varm_uint64(integer ncid, integer varid,  inte‐
1065              ger  start(1),  integer count(1), integer stride(1), imap, inte‐
1066              ger*8 in(1))
1067
1068       integer function nf_get_varm_string(integer ncid, integer varid,  inte‐
1069              ger start(1), integer count(1), integer stride(1), imap, charac‐
1070              ter* in(1))
1071
1072
1073
1074              These functions are used for mapped input, which is like strided
1075              input  described  above, except that an additional index mapping
1076              vector is provided to specify the in-memory arrangement  of  the
1077              data  values.   For  an explanation of the index mapping vector,
1078              see COMMON ARGUMENTS DESCRIPTIONS below.
1079

ATTRIBUTES

1081       integer function nf_put_att_text(integer ncid, integer  varid,  charac‐
1082              ter*(*) name, integer xtype, integer len, character*(*) out)
1083
1084
1085       integer  function  nf_put_att_int1(integer ncid, integer varid, charac‐
1086              ter*(*) name, integer xtype, integer len, integer*1 out(1))
1087
1088       integer function nf_put_att_int2(integer ncid, integer  varid,  charac‐
1089              ter*(*) name, integer xtype, integer len, integer*2 out(1))
1090
1091       integer  function  nf_put_att_int(integer  ncid, integer varid, charac‐
1092              ter*(*) name, integer xtype, integer len, integer out(1))
1093
1094
1095       integer function nf_put_att_real(integer ncid, integer  varid,  charac‐
1096              ter*(*) name, integer xtype, integer len, real out(1))
1097
1098       integer function nf_put_att_double(integer ncid, integer varid, charac‐
1099              ter*(*)  name,  integer  xtype,  integer  len,   doubleprecision
1100              out(1))
1101
1102       integer  function nf_put_att_ubyte(integer ncid, integer varid, charac‐
1103              ter*(*) name, integer xtype, integer len, integer*1 out(1))
1104
1105       integer function nf_put_att_ushort(integer ncid, integer varid, charac‐
1106              ter*(*) name, integer xtype, integer len, integer*2 out(1))
1107
1108       integer  function  nf_put_att_uint(integer ncid, integer varid, charac‐
1109              ter*(*) name, integer xtype, integer len, integer*4 out(1))
1110
1111       integer function nf_put_att_(integer ncid, integer varid, character*(*)
1112              name, integer xtype, integer len, integer*8 out(1))
1113
1114       integer function nf_put_att_uint64(integer ncid, integer varid, charac‐
1115              ter*(*) name, integer xtype, integer len, integer*8 out(1))
1116
1117       integer function nf_put_att_string(integer ncid, integer varid, charac‐
1118              ter*(*) name, integer xtype, integer len, character* out(1))
1119
1120
1121
1122       integer  function nf_put_att(integer ncid, integer varid, character*(*)
1123              name, integer xtype, integer len, void * ip)
1124
1125       integer function nf_get_att(integer ncid, integer varid,  character*(*)
1126              name, void * ip)
1127
1128              Unlike  variables, attributes do not have separate functions for
1129              defining and writing values.  This family of functions defines a
1130              new  attribute  with a value or changes the value of an existing
1131              attribute.  If the attribute is new, or if the space required to
1132              store  the  attribute  value  is greater than before, the netCDF
1133              dataset must be in define mode.  The parameter len is the number
1134              of  values  from  out to transfer.  It is often one, except that
1135              for nf_put_att_text() it will usually be len_trim(out).
1136
1137              For these functions, the type component  of  the  function  name
1138              refers to the in-memory type of the value, whereas the xtype ar‐
1139              gument refers to the external type for storing  the  value.   An
1140              NF_ERANGE  error  results if a conversion between these types is
1141              not possible.  In this case the value is  represented  with  the
1142              appropriate fill-value for the associated external type.
1143
1144       integer  function  nf_inq_attname(integer  ncid, integer varid, integer
1145              attnum, character*(*) name)
1146
1147              Gets the name of an attribute, given its  variable  ID  and  at‐
1148              tribute number.  This function is useful in generic applications
1149              that need to get the names of all the attributes associated with
1150              a  variable,  since  attributes are accessed by name rather than
1151              number in all other attribute functions.  The number of  an  at‐
1152              tribute is more volatile than the name, since it can change when
1153              other attributes of the same  variable  are  deleted.   The  at‐
1154              tributes  for  each  variable are numbered from 1 (the first at‐
1155              tribute) to nvatts, where nvatts is the number of attributes for
1156              the variable, as returned from a call to nf_inq_varnatts().
1157
1158
1159       integer  function nf_inq_att(integer ncid, integer varid, character*(*)
1160              name, integer xtype, integer len)
1161
1162       integer function  nf_inq_attid(integer  ncid,  integer  varid,  charac‐
1163              ter*(*) name, integer attnum)
1164
1165       integer  function  nf_inq_atttype(integer  ncid, integer varid, charac‐
1166              ter*(*) name, integer xtype)
1167
1168       integer function nf_inq_attlen(integer  ncid,  integer  varid,  charac‐
1169              ter*(*) name, integer len)
1170
1171              These  functions  return  information  about a netCDF attribute,
1172              given its variable ID and name.  The information returned is the
1173              external  type  in  xtype  and the number of elements in the at‐
1174              tribute as len.
1175
1176
1177       integer function nf_copy_att(integer ncid,  integer  varid_in,  charac‐
1178              ter*(*) name, integer ncid_out, integer varid_out)
1179
1180              Copies  an attribute from one netCDF dataset to another.  It can
1181              also be used to copy an attribute from one variable  to  another
1182              within  the  same  netCDF.  ncid_in is the netCDF ID of an input
1183              netCDF  dataset  from  which  the  attribute  will  be   copied.
1184              varid_in  is  the ID of the variable in the input netCDF dataset
1185              from which the attribute will be  copied,  or  NF_GLOBAL  for  a
1186              global  attribute.  name is the name of the attribute in the in‐
1187              put netCDF dataset to be copied.  ncid_out is the netCDF  ID  of
1188              the output netCDF dataset to which the attribute will be copied.
1189              It is permissible for the input and output netCDF ID's to be the
1190              same.  The output netCDF dataset should be in define mode if the
1191              attribute to be copied does not already  exist  for  the  target
1192              variable,  or  if it would cause an existing target attribute to
1193              grow.  varid_out is the ID of the variable in the output  netCDF
1194              dataset  to  which the attribute will be copied, or NF_GLOBAL to
1195              copy to a global attribute.
1196
1197       integer function nf_rename_att(integer  ncid,  integer  varid,  charac‐
1198              ter*(*) name, character*(*) newname)
1199
1200              Changes  the  name  of  an attribute.  If the new name is longer
1201              than the original name, the netCDF must be in define mode.   You
1202              cannot  rename an attribute to have the same name as another at‐
1203              tribute of the same variable.  name is  the  original  attribute
1204              name.   newname  is the new name to be assigned to the specified
1205              attribute.  If the new name is longer than  the  old  name,  the
1206              netCDF dataset must be in define mode.
1207
1208       integer  function nf_del_att(integer ncid, integer varid, character*(*)
1209              name)
1210
1211              Deletes an attribute from a netCDF dataset.  The dataset must be
1212              in define mode.
1213
1214       integer  function  nf_get_att_text(integer ncid, integer varid, charac‐
1215              ter*(*) name, character*(*) in)
1216
1217
1218       integer function nf_get_att_int1(integer ncid, integer  varid,  charac‐
1219              ter*(*) name, integer*1 in(1))
1220
1221       integer  function  nf_get_att_int2(integer ncid, integer varid, charac‐
1222              ter*(*) name, integer*2 in(1))
1223
1224       integer function nf_get_att_int(integer ncid,  integer  varid,  charac‐
1225              ter*(*) name, integer in(1))
1226
1227
1228       integer  function  nf_get_att_real(integer ncid, integer varid, charac‐
1229              ter*(*) name, real in(1))
1230
1231       integer function nf_get_att_double(integer ncid, integer varid, charac‐
1232              ter*(*) name, doubleprecision in(1))
1233
1234       integer  function nf_get_att_ubyte(integer ncid, integer varid, charac‐
1235              ter*(*) name, integer*1 in(1))
1236
1237       integer function nf_get_att_ushort(integer ncid, integer varid, charac‐
1238              ter*(*) name, integer*2 in(1))
1239
1240       integer  function  nf_get_att_uint(integer ncid, integer varid, charac‐
1241              ter*(*) name, integer*4 in(1))
1242
1243       integer function nf_get_att_(integer ncid, integer varid, character*(*)
1244              name, integer*8 in(1))
1245
1246       integer function nf_get_att_uint64(integer ncid, integer varid, charac‐
1247              ter*(*) name, integer*8 in(1))
1248
1249       integer function nf_get_att_string(integer ncid, integer varid, charac‐
1250              ter*(*) name, character* in(1))
1251
1252
1253
1254              Gets  the  value(s) of a netCDF attribute, given its variable ID
1255              and name.  Converts from the external type to the type specified
1256              in   the  function  name,  if  possible,  otherwise  returns  an
1257              NF_ERANGE error.  All elements of the vector of attribute values
1258              are  returned,  so  you must allocate enough space to hold them.
1259              If you don't know how much space  to  reserve,  call  nf_inq_at‐
1260              tlen() first to find out the length of the attribute.
1261

COMMON ARGUMENT DESCRIPTIONS

1263       In  this  section we define some common arguments which are used in the
1264       "FUNCTION DESCRIPTIONS" section.
1265
1266       integer ncid
1267              is the netCDF ID returned from a previous,  successful  call  to
1268              nf_open() or nf_create()
1269
1270       character*(*) name
1271              is the name of a dimension, variable, or attribute. The names of
1272              dimensions, variables and attributes consist  of  arbitrary  se‐
1273              quences  of  alphanumeric characters (as well as underscore '_',
1274              period '.' and hyphen '-'), beginning with a  letter  or  under‐
1275              score.  (However  names  commencing with underscore are reserved
1276              for system use.) Case is significant in netCDF  names.  A  zero-
1277              length name is not allowed.
1278
1279              The maximum allowable number of characters
1280               is NF_MAX_NAME.
1281
1282       integer xtype
1283              specifies  the  external  data  type of a netCDF variable or at‐
1284              tribute and is one of the following: NF_BYTE, NF_CHAR, NF_SHORT,
1285              NF_INT, NF_FLOAT, or NF_DOUBLE.  These are used to specify 8-bit
1286              integers, characters, 16-bit integers, 32-bit  integers,  32-bit
1287              IEEE floating point numbers, and 64-bit IEEE floating-point num‐
1288              bers, respectively.
1289
1290
1291       integer dimids(1)
1292              is a vector of dimension ID's and defines the shape of a  netCDF
1293              variable.  The size of the vector shall be greater than or equal
1294              to the rank (i.e. the number  of  dimensions)  of  the  variable
1295              (ndims).   The vector shall be ordered by the speed with which a
1296              dimension varies: dimids(1) shall be the  dimension  ID  of  the
1297              most  rapidly  varying  dimension and dimids(ndims) shall be the
1298              dimension ID of the most slowly varying dimension.  The  maximum
1299              possible  number  of  dimensions  for a variable is given by the
1300              symbolic constant NF_MAX_VAR_DIMS.
1301
1302       integer dimid
1303              is the ID of a netCDF dimension.  netCDF dimension ID's are  al‐
1304              located  sequentially  from the positive integers beginning with
1305              1.
1306
1307       integer ndims
1308              is either the total number of dimensions in a netCDF dataset  or
1309              the  rank  (i.e. the number of dimensions) of a netCDF variable.
1310              The value shall not be negative or  greater  than  the  symbolic
1311              constant NF_MAX_VAR_DIMS.
1312
1313       integer varid
1314              is  the  ID  of  a  netCDF variable or (for the attribute-access
1315              functions) the symbolic constant NF_GLOBAL,  which  is  used  to
1316              reference global attributes.  netCDF variable ID's are allocated
1317              sequentially from the positive integers beginning with 1.
1318
1319       integer natts
1320              is the number of global attributes in a netCDF dataset  for  the
1321              nf_inquire()  function  or  the  number of attributes associated
1322              with a netCDF variable for the nf_varinq() function.
1323
1324       integer index(1)
1325              specifies the indicial coordinates of the netCDF data  value  to
1326              be  accessed.   The  indices  start at 1; thus, for example, the
1327              first data value of a two-dimensional variable  is  (1,1).   The
1328              size  of the vector shall be at least the rank of the associated
1329              netCDF variable and its elements shall correspond, in order,  to
1330              the variable's dimensions.
1331
1332       integer start(1)
1333              specifies  the  starting point for accessing a netCDF variable's
1334              data values in terms of the indicial coordinates of  the  corner
1335              of  the  array section.  The indices start at 1; thus, the first
1336              data value of a variable is (1, 1, ..., 1).   The  size  of  the
1337              vector shall be at least the rank of the associated netCDF vari‐
1338              able and its elements shall correspond, in order, to  the  vari‐
1339              able's dimensions.
1340
1341       integer count(1)
1342              specifies the number of indices selected along each dimension of
1343              the array section.  Thus, to access a single value, for example,
1344              specify  count  as  (1, 1, ..., 1).  Note that, for strided I/O,
1345              this argument must be adjusted to be compatible with the  stride
1346              and  start  arguments  so that the interaction of the three does
1347              not attempt to access an invalid data co-ordinate.  The elements
1348              of  the count vector correspond, in order, to the variable's di‐
1349              mensions.
1350
1351       integer stride(1)
1352              specifies the sampling interval  along  each  dimension  of  the
1353              netCDF variable.   The elements of the stride vector correspond,
1354              in order, to the netCDF variable's dimensions (stride(1))  gives
1355              the  sampling  interval along the most rapidly varying dimension
1356              of the netCDF variable).  Sampling intervals  are  specified  in
1357              type-independent units of elements (a value of 1 selects consec‐
1358              utive elements of the netCDF variable  along  the  corresponding
1359              dimension, a value of 2 selects every other element, etc.).
1360
1361
1362       imap   specifies  the  mapping between the dimensions of a netCDF vari‐
1363              able and the in-memory structure of  the  internal  data  array.
1364              The  elements  of the index mapping vector correspond, in order,
1365              to the netCDF variable's dimensions (imap(1) gives the  distance
1366              between elements of the internal array corresponding to the most
1367              rapidly varying dimension of the  netCDF  variable).   Distances
1368              between elements are specified in type-independent units of ele‐
1369              ments (the distance between internal elements that occupy  adja‐
1370              cent  memory locations is 1 and not the element's byte-length as
1371              in netCDF 2).
1372
1373

VARIABLE PREFILLING

1375       By default, the netCDF interface sets the values of  all  newly-defined
1376       variables  of  finite length (i.e. those that do not have an unlimited,
1377       dimension) to the type-dependent fill-value associated with each  vari‐
1378       able.   This  is done when nf_enddef() is called.  The fill-value for a
1379       variable may be changed from the default  value  by  defining  the  at‐
1380       tribute  `_FillValue'  for  the variable.  This attribute must have the
1381       same type as the variable and be of length one.
1382
1383       Variables with an unlimited dimension are also prefilled, but on an `as
1384       needed'  basis.   For example, if the first write of such a variable is
1385       to position 5, then positions 1 through 4 (and no others) would be  set
1386       to the fill-value at the same time.
1387
1388       This  default  prefilling  of data values may be disabled by or'ing the
1389       NF_NOFILL flag into the mode parameter of nf_open() or nf_create(), or,
1390       by calling the function nf_set_fill() with the argument NF_NOFILL.  For
1391       variables that do not use the unlimited dimension, this  call  must  be
1392       made  before  nf_enddef().  For variables that use the unlimited dimen‐
1393       sion, this call may be made at any time.
1394
1395       One can obtain increased performance of the netCDF interface  by  using
1396       this  feature,  but only at the expense of requiring the application to
1397       set every single data value.  The  performance  enhancing  behavior  of
1398       this function is dependent on the particulars of the implementation and
1399       dataset format.  The flag value  controlled  by  nf_set_fill()  is  per
1400       netCDF  ID, not per variable or per write.  Allowing this to change af‐
1401       fects the degree to which a program can  be  effectively  parallelized.
1402       Given  all  of  this,  we state that the use of this feature may not be
1403       available (or even needed) in future  releases.  Programmers  are  cau‐
1404       tioned against heavy reliance upon this feature.
1405
1406       integer  function  nf_setfill(integer  ncid,  integer fillmode, integer
1407              old_fillemode)
1408
1409
1410              Determines whether or not variable prefilling will be done  (see
1411              above).   The netCDF dataset shall be writable.  fillmode is ei‐
1412              ther NF_FILL to enable prefilling (the default) or NF_NOFILL  to
1413              disable  prefilling.  This function returns the previous setting
1414              in old_fillmode.
1415
1416
1417
1418

MPP FUNCTION DESCRIPTIONS

1420       Additional functions for  use  on  SGI/Cray  MPP  machines  (_CRAYMPP).
1421       These  are  used  to set and inquire which PE is the base for MPP for a
1422       particular netCDF. These are only  relevant  when  using  the  SGI/Cray
1423       ``global''  Flexible File I/O layer and desire to have only a subset of
1424       PEs to open the specific netCDF file.   For  technical  reasons,  these
1425       functions  are  available  on  all platforms.  On a platform other than
1426       SGI/Cray MPP, it is as if only processor available were processor 0.
1427
1428       To use this feature, you need to specify a communicator group and  call
1429       glio_group_mpi()  or  glio_group_shmem()  prior to the netCDF nf_open()
1430       and nf_create() calls.
1431
1432       integer function nf__create_mp(character*(*) path, integer cmode, inte‐
1433              ger initialsize, integer pe, integer chunksize, integer ncid)
1434
1435              Like nf__create() but allows the base PE to be set.
1436
1437              The  argument  pe  sets the base PE at creation time. In the MPP
1438              environment, nf__create() and nf_create() set  the  base  PE  to
1439              processor zero by default.
1440
1441       integer  function nf__open_mp(character*(*) path, integer mode, integer
1442              pe, integer chunksize, integer ncid)
1443
1444              Like nf__open() but allows the base PE to be set.  The  argument
1445              pe  sets  the  base PE at creation time. In the MPP environment,
1446              nf__open() and nf_open() set the base PE to  processor  zero  by
1447              default.
1448
1449       integer function nf_inq_base_pe(integer ncid, integer pe)
1450
1451              Inquires  of  the  netCDF  dataset which PE is being used as the
1452              base for MPP use.  This is safe to use at any time.
1453
1454       integer function nf_set_base_pe(integer ncid, integer pe)
1455
1456              Resets the base PE for the netCDF dataset.   Only  perform  this
1457              operation  when the affected communicator group synchronizes be‐
1458              fore and after the call.   This  operation  is  very  risky  and
1459              should only be contemplated under only the most extreme cases.
1460

ENVIRONMENT VARIABLES

1462       NETCDF_FFIOSPEC
1463           Specifies the Flexible File I/O buffers for netCDF I/O when execut‐
1464           ing under the UNICOS operating system (the variable is  ignored  on
1465           other operating systems).  An appropriate specification can greatly
1466           increase the efficiency of netCDF I/O -- to the extent that it  can
1467           actually surpass FORTRAN binary I/O.  This environment variable has
1468           been made a little more generalized, such that  other  FFIO  option
1469           specifications  can now be added.  The default specification is bu‐
1470           fa:336:2, unless a current  FFIO  specification  is  in  operation,
1471           which  will  be honored.  See UNICOS Flexible File I/O for more in‐
1472           formation.
1473

MAILING-LISTS

1475       Both a mailing list and a digest are available for  discussion  of  the
1476       netCDF  interface  and  announcements about netCDF bugs, fixes, and en‐
1477       hancements.  To begin or change your subscription to either  the  mail‐
1478       ing-list  or the digest, send one of the following in the body (not the
1479       subject line) of an email message to "majordomo@unidata.ucar.edu".  Use
1480       your email address in place of jdoe@host.inst.domain.
1481
1482       To subscribe to the netCDF mailing list:
1483              subscribe netcdfgroup jdoe@host.inst.domain
1484       To unsubscribe from the netCDF mailing list:
1485              unsubscribe netcdfgroup jdoe@host.inst.domain
1486       To subscribe to the netCDF digest:
1487              subscribe netcdfdigest jdoe@host.inst.domain
1488       To unsubscribe from the netCDF digest:
1489              unsubscribe netcdfdigest jdoe@host.inst.domain
1490       To retrieve the general introductory information for the mailing list:
1491              info netcdfgroup
1492       To get a synopsis of other majordomo commands:
1493              help
1494

SEE ALSO

1496       ncdump(1), ncgen(1), netcdf(3f).
1497
1498       netCDF User's Guide, published by the Unidata Program Center, Universi‐
1499       ty Corporation for Atmospheric Research, located in Boulder, Colorado.
1500
1501       NetCDF home page at http:/www.unidata.ucar.edu/netcdf.
1502
1503
1504
1505Printed: 2019-06-22               1997-04-18                         NETCDF(3)
Impressum