File: guidef-13.html

package info (click to toggle)
netcdf-doc 1%3A3a-2.1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, sarge
  • size: 3,052 kB
  • ctags: 1,463
  • sloc: makefile: 58; sh: 17
file content (455 lines) | stat: -rw-r--r-- 41,522 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
<!-- Generated by Harlequin WebMaker 2.2.3 (24-Apr-1996)
LispWorks 3.2.2 -->
<HTML> <HEAD>
<TITLE>8	 Attributes</TITLE>
</HEAD>
<BODY bgcolor="#ffffff">
<A NAME=HEADING13></A>
<A HREF="guidef-14.html">[Next] </A><A HREF="guidef-12.html">[Previous] </A><A HREF="guidef-1.html">[Top] </A><A HREF="guidef-3.html">[Contents] </A><A HREF="guidef-21.html">[Index] </A><A HREF="http://www.unidata.ucar.edu/packages/netcdf/">[netCDF Home Page]</A><A HREF="http://www.unidata.ucar.edu/">[Unidata Home Page]</A><P>
NetCDF User's Guide for Fortran<P>
<A NAME=HEADING13-0></A>
<H1>8  <A NAME=MARKER-9-2903></A>Attributes</H1>
<HR>
 <A NAME=MARKER-2-2910></A><A NAME=MARKER-2-2911></A>Attributes may be associated with each netCDF variable to specify such properties as units, special values, maximum and minimum valid values, scaling factors, and offsets. Attributes for a netCDF dataset are defined when the dataset is first created, while the netCDF dataset is in define mode. Additional attributes may be added later by reentering define mode. A netCDF attribute has a netCDF variable to which it is assigned, a name, a type, a length, and a sequence of one or more values. An attribute is designated by its variable ID and name. When an attribute name is not known, it may be designated by its variable ID and number in order to determine its name, using the function  <A NAME=MARKER-10-2912></A><CODE>NF_INQ_ATTNAME</CODE>.<P>
 <A NAME=MARKER-2-2914></A><A NAME=MARKER-2-2915></A><A NAME=MARKER-2-2916></A><A NAME=MARKER-2-2917></A><A NAME=MARKER-2-2918></A><A NAME=MARKER-2-2919></A><A NAME=MARKER-2-2920></A><A NAME=MARKER-2-2921></A>The attributes associated with a variable are typically defined immediately after the variable is created, while still in <A NAME=MARKER-2-2924></A><A NAME=MARKER-2-2925></A><A NAME=MARKER-2-2928></A><A NAME=MARKER-2-2929></A>define mode. The data type, length, and value of an attribute may be changed even when in data mode, as long as the changed attribute requires no more space than the attribute as originally defined. <P>
 It is also possible to have attributes that are not associated with any variable. These are called <A NAME=MARKER-2-2930></A><A NAME=MARKER-2-2931></A><I>global attributes</I> and are identified by using <A NAME=MARKER-10-2932></A><CODE><A NAME=MARKER-2-2933></A>NF_GLOBAL</CODE> as a variable pseudo-ID. Global attributes are usually related to the netCDF dataset as a whole and may be used for purposes such as providing a title or processing history for a netCDF dataset. <P>
 <A NAME=MARKER-2-2934></A><A NAME=MARKER-2-2935></A>Operations supported on attributes are:<P>
<UL>
<LI>Create an attribute, given its variable ID, name, data type, length, and value.<P>
<LI>Get attribute's data type and length from its variable ID and name.<P>
<LI>Get attribute's value from its variable ID and name.<P>
<LI>Copy attribute from one netCDF variable to another.<P>
<LI>Get name of attribute from its number.<P>
<LI>Rename an attribute.<P>
<LI>Delete an attribute.<P>
</UL>
<A NAME=HEADING13-12></A>
<H2>8.1  <A NAME=MARKER-9-2936></A>Attribute Conventions</H2>
<HR>
 Names commencing with underscore ('<CODE>_</CODE>') are reserved for use by the netCDF library. Most generic applications that process netCDF datasets assume standard <A NAME=MARKER-2-2939></A><A NAME=MARKER-2-2940></A>attribute conventions and it is strongly recommended that these be followed unless there are good reasons for not doing so. Below we list the names and meanings of recommended standard attributes that have proven useful. Note that some of these (e.g. <CODE>units</CODE>, <CODE>valid_range</CODE>, <CODE>scale_factor</CODE>) assume numeric data and should not be used with character data. 
<TABLE BORDER="1"><TD><CODE><A NAME=MARKER-2-4></A>units</CODE><TD>A character string that specifies the units used for the variable's data. Unidata has developed a freely-available library of routines to convert between character string and binary forms of unit specifications and to perform various useful operations on the binary forms. This library is used in some netCDF applications. Using the recommended units syntax permits data represented in conformable units to be automatically converted to common units for arithmetic operations. <A HREF=guidef-17.html#MARKER-9-3305>See Appendix A "Units,"  page 113</A>, for more information. <TR>
<TD><CODE><A NAME=MARKER-2-6></A><A NAME=MARKER-2-7></A>long_name</CODE><TD>A long descriptive name. This could be used for labeling plots, for example. If a variable has no <CODE>long_name</CODE> attribute assigned, the variable name should be used as a default. <TR>
<TD><CODE><A NAME=MARKER-2-8></A><A NAME=MARKER-2-9></A>valid_min</CODE><TD>A scalar specifying the minimum valid value for this variable.<TR>
<TD><CODE><A NAME=MARKER-2-10></A><A NAME=MARKER-2-11></A>valid_max</CODE><TD>A scalar specifying the maximum valid value for this variable.<TR>
<TD><CODE><A NAME=MARKER-2-12></A><A NAME=MARKER-2-13></A>valid_range</CODE><TD>A vector of two numbers specifying the minimum and maximum valid values for this variable, equivalent to specifying values for both <CODE>valid_min</CODE> and <CODE>valid_max</CODE> attributes. Any of these attributes define the <A NAME=MARKER-2-14></A><A NAME=MARKER-2-15></A><A NAME=MARKER-2-16></A><I>valid range</I>. The attribute <CODE>valid_range</CODE> must not be defined if either <CODE>valid_min</CODE> or <CODE>valid_max</CODE> is defined. <P>Generic applications should treat values outside the <I>valid range</I> as missing. The type of each <CODE>valid_range</CODE>, <CODE>valid_min</CODE> and <CODE>valid_max</CODE> attribute should match the type of its variable (except that for <CODE>byte</CODE> data, these can be of a signed integral type to specify the intended range). <P>If neither <CODE>valid_min</CODE>, <CODE>valid_max</CODE> nor <CODE>valid_range</CODE> is defined then generic applications should define a valid range as follows. If the data type is byte and <CODE>_FillValue</CODE> is not explicitly defined, then the valid range should include all possible values. Otherwise, the valid range should exclude the <CODE>_FillValue</CODE> (whether defined explicitly or by default) as follows. If the <CODE>_FillValue</CODE> is positive then it defines a valid maximum, otherwise it defines a valid minimum. For integer types, there should be a difference of 1 between the <CODE>_FillValue</CODE> and this valid minimum or maximum. For floating point types, the difference should be twice the minimum possible (1 in the least significant bit) to allow for rounding error.<TR>
<TD><CODE><A NAME=MARKER-2-19></A><A NAME=MARKER-2-20></A>scale_factor</CODE><TD>If present for a variable, the data are to be <A NAME=MARKER-2-21></A><A NAME=MARKER-2-22></A>multiplied by this factor after the data are read by the application that accesses the data.<TR>
<TD><CODE><A NAME=MARKER-2-25></A><A NAME=MARKER-2-26></A>add_offset</CODE><TD>If present for a variable, this number is to be added to the data after it is read by the application that accesses the data. If both <CODE>scale_factor</CODE> and <CODE>add_offset</CODE> attributes are present, the data are first scaled before the offset is added. The attributes <CODE>scale_factor</CODE> and <CODE>add_offset</CODE> can be used together to provide simple data compression to store low-<A NAME=MARKER-2-29></A><A NAME=MARKER-2-30></A>resolution floating-point data as small integers in a netCDF dataset. When scaled data are written, the application should first subtract the offset and then divide by the scale factor. <P>When <CODE>scale_factor</CODE> and <CODE>add_offset</CODE> are used for packing, the associated variable (containing the packed data) is typically of type byte or short, whereas the unpacked values are intended to be of type float or double. The attributes <CODE>scale_factor</CODE> and <CODE>add_offset</CODE> should both be of the type intended for the unpacked data, e.g. float or double.<TR>
<TD><CODE><A NAME=MARKER-2-33></A><A NAME=MARKER-2-35></A><A NAME=MARKER-2-36></A>_FillValue</CODE><TD>The <CODE>_FillValue</CODE> attribute specifies the <I>fill value</I> used to pre-fill disk space allocated to the variable. Such pre-fill occurs unless <I>nofill mode</I> is set using <A NAME=MARKER-10-39></A><CODE>NF_SET_FILL</CODE>. <A HREF=guidef-10.html#MARKER-9-2270>See Section 5.12 "Set Fill Mode for Writes: NF_SET_FILL,"  page 39</A>, for details. The <I>fill value</I> is returned when reading values that were never written. If <CODE>_FillValue</CODE> is defined then it should be scalar and of the same type as the variable. It is not necessary to define your own <CODE>_FillValue </CODE>attribute for a variable if the default <I>fill value</I> for the type of the variable is adequate. However, use of the default fill value for data type byte is not recommended. Note that if you change the value of this attribute, the changed value applies only to subsequent writes; previously written data are not changed. <P>Generic applications often need to write a value to represent undefined or missing values. The <I>fill value</I> provides an appropriate value for this purpose because it is normally outside the <I>valid range</I> and therefore treated as missing when read by generic applications. It is legal (but not recommended) for the <I>fill value</I> to be within the <I>valid range</I>. <P><A HREF=guidef-12.html#MARKER-9-2867>See Section 7.16 "Fill Values,"  page 78</A>, for more information.<TR>
<TD><CODE><A NAME=MARKER-2-42></A><A NAME=MARKER-2-43></A>missing_value</CODE><TD>This attribute is not treated in any special way by the library or conforming generic applications, but is often useful documentation and may be used by specific applications. The <CODE>missing_value</CODE> attribute can be a scalar or vector containing values indicating missing data. These values should all be outside the <I>valid range</I> so that generic applications will treat them as missing.<TR>
<TD><CODE><A NAME=MARKER-2-44></A><A NAME=MARKER-2-45></A>signedness</CODE><TD>Deprecated attribute, originally designed to indicate whether byte values should be treated as <A NAME=MARKER-2-46></A><A NAME=MARKER-2-47></A>signed or unsigned. The attributes <CODE>valid_min</CODE> and <CODE>valid_max</CODE> may be used for this purpose. For example, if you intend that a byte variable store only nonnegative values, you can use <CODE>valid_min = 0</CODE> and <CODE>valid_max = 255</CODE>. This attribute is ignored by the netCDF library.<TR>
<TD><CODE><A NAME=MARKER-2-50></A><A NAME=MARKER-2-51></A>C_format</CODE><TD>A character array providing the format that should be used by C applications to <A NAME=MARKER-2-52></A><A NAME=MARKER-2-53></A>print values for this variable. For example, if you know a variable is only accurate to three significant digits, it would be appropriate to define the <CODE>C_format</CODE> attribute as <CODE>&quot;%.3g&quot;</CODE>. The <CODE>ncdump</CODE> utility program uses this attribute for variables for which it is defined. The format applies to the scaled (internal) type and value, regardless of the presence of the scaling attributes <CODE>scale_factor</CODE> and <CODE>add_offset</CODE>.<TR>
<TD><CODE><A NAME=MARKER-2-54></A><A NAME=MARKER-2-55></A>FORTRAN_format</CODE><TD>A character array providing the format that should be used by FORTRAN applications to print values for this variable. For example, if you know a variable is only accurate to three significant digits, it would be appropriate to define the <CODE>FORTRAN_format</CODE> attribute as <CODE>&quot;(G10.3)&quot;</CODE>.<TR>
<TD><CODE><A NAME=MARKER-2-56></A><A NAME=MARKER-2-57></A>title</CODE><TD>A global attribute that is a character array providing a succinct description of what is in the dataset.<TR>
<TD><CODE><A NAME=MARKER-2-58></A><A NAME=MARKER-2-59></A>history</CODE><TD>A global attribute for an <A NAME=MARKER-2-61></A><A NAME=MARKER-2-62></A><A NAME=MARKER-2-63></A>audit trail. This is a character array with a line for each invocation of a program that has modified the dataset. Well-behaved generic netCDF applications should append a line containing: date, time of day, user name, program name and command arguments.<TR>
<TD><CODE><A NAME=MARKER-2-66></A><A NAME=MARKER-2-67></A>Conventions</CODE><TD>If present, '<CODE>Conventions</CODE>' is a global attribute that is a character array for the name of the conventions followed by the dataset, in the form of a string that is interpreted as a directory name relative to a directory that is a repository of documents describing sets of discipline-specific conventions. This permits a hierarchical structure for conventions and provides a place where descriptions and examples of the conventions may be maintained by the defining institutions and groups. The conventions directory name is currently interpreted relative to the directory <CODE>pub/netcdf/Conventions/</CODE> on the host machine <CODE>ftp.unidata.ucar.edu</CODE>. Alternatively, a full URL specification may be used to name a WWW site where documents that describe the conventions are maintained. <TR>
<TD>&nbsp;<TD>For example, if a group named NUWG agrees upon a set of conventions for dimension names, variable names, required attributes, and netCDF representations for certain <A NAME=MARKER-2-68></A><A NAME=MARKER-2-69></A>discipline-specific data structures, they may store a document describing the agreed-upon conventions in a dataset in the <CODE>NUWG/</CODE> subdirectory of the Conventions directory. Datasets that followed these conventions would contain a global <CODE>Conventions</CODE> attribute with value <CODE>&quot;NUWG&quot;</CODE>. <TR>
<TD>&nbsp;<TD>Later, if the group agrees upon some additional conventions for a specific subset of NUWG data, for example time series data, the description of the additional conventions might be stored in the <CODE>NUWG/Time_series/</CODE> subdirectory, and datasets that adhered to these additional conventions would use the global <CODE>Conventions</CODE> attribute with value <CODE>&quot;NUWG/Time_series&quot;</CODE>, implying that this dataset adheres to the NUWG conventions and also to the additional NUWG time-series conventions.</TABLE>
<P>
<A NAME=HEADING13-14></A>
<H2>8.2  Create an Attribute:   <A NAME=MARKER-10-2941></A><CODE><A NAME=MARKER-2-2942></A>NF_PUT_ATT_type<B> </B></CODE></H2>
<HR>
 The function <A NAME=MARKER-10-2943></A><CODE>NF_PUT_ATT_<B>type</B></CODE> adds or changes a variable attribute or global attribute of an open netCDF dataset. If this attribute is new, or if the space required to store the attribute is greater than before, the netCDF dataset must be in <A NAME=MARKER-2-2944></A><A NAME=MARKER-2-2945></A><A NAME=MARKER-2-2946></A>define mode.<P>
<A NAME=HEADING13-16></A>
<H4>Usage </H4>
 Although it's possible to create attributes of all types, text and double attributes are adequate for most purposes.<P>
<PRE>
<A NAME=MARKER-10-2947></A>INTEGER FUNCTION  NF_PUT_ATT_TEXT  (INTEGER NCID, INTEGER VARID,
                                    CHARACTER*(*) NAME, INTEGER LEN,
                                    CHARACTER*(*) TEXT)
INTEGER FUNCTION  NF_PUT_ATT_INT1  (INTEGER NCID, INTEGER VARID,
                                    CHARACTER*(*) NAME, INTEGER XTYPE,
                                    LEN, INTEGER*1 I1VALS(*))
INTEGER FUNCTION  NF_PUT_ATT_INT2  (INTEGER NCID, INTEGER VARID,
                                     CHARACTER*(*) NAME, INTEGER XTYPE,
                                    LEN, INTEGER*2 I2VALS(*))
INTEGER FUNCTION  NF_PUT_ATT_INT   (INTEGER NCID, INTEGER VARID,
                                    CHARACTER*(*) NAME, INTEGER XTYPE,
                                    LEN, INTEGER IVALS(*))
INTEGER FUNCTION  NF_PUT_ATT_REAL  (INTEGER NCID, INTEGER VARID,
                                    CHARACTER*(*) NAME, INTEGER XTYPE,
                                    LEN, REAL RVALS(*))
INTEGER FUNCTION  NF_PUT_ATT_DOUBLE(INTEGER NCID, INTEGER VARID,
                                    CHARACTER*(*) NAME, INTEGER XTYPE,
                                    LEN, DOUBLE DVALS(*))
<TABLE BORDER="1"><TD><CODE>NCID</CODE><TD>NetCDF ID, from a previous call to <CODE>NF_OPEN</CODE> or <CODE>NF_CREATE</CODE>.<TR>
<TD><CODE>VARID</CODE><TD>Variable ID.<TR>
<TD><CODE>NAME</CODE><TD>Attribute name. Must begin with an alphabetic character, followed by zero or more alphanumeric characters including the underscore ('<CODE>_</CODE>'). Case is significant. Attribute name conventions are assumed by some netCDF generic applications, e.g., <CODE>units</CODE> as the name for a string attribute that gives the units for a netCDF variable. A table of conventional attribute names is presented in the earlier chapter on the netCDF interface. <TR>
<TD><CODE>XTYPE</CODE><TD>One of the set of predefined netCDF external data types. The valid netCDF external data types are <CODE>NF_BYTE</CODE>, <CODE>NF_CHAR</CODE>, <CODE>NF_SHORT</CODE>, <CODE>NF_INT</CODE>, <CODE>NF_FLOAT</CODE>, and <CODE>NF_DOUBLE</CODE>. Although it's possible to create attributes of all types, <CODE>NF_CHAR</CODE> and <CODE>NF_DOUBLE</CODE> attributes are adequate for most purposes. <TR>
<TD><CODE>LEN</CODE><TD>The number of values provided for the attribute, or the length of the text attribute for <CODE>NF_PUT_ATT_TEXT</CODE>.<TR>
<TD><CODE>TEXT, I1VALS, 
I2VALS, IVALS,RVALS, or DVALS</CODE><TD>An array of LEN attribute values. The data should be of a type appropriate for the function called. You cannot write CHARACTER data into a numeric attribute or numeric data into a text attribute. For numeric data, if the type of data differs from the attribute type, type conversion will occur (see Section 3.3 "Type Conversion," page 24, for details).</TABLE>

</PRE>
Errors <P>
 <CODE><A NAME=MARKER-10-2948></A>NF_PUT_ATT_<B>type</B></CODE> returns the value <A NAME=MARKER-10-2949></A><CODE>NF_NOERR</CODE> if no errors occurred. Otherwise, the returned status indicates an error. Possible causes of errors include:<P>
<UL>
<LI>The variable ID is invalid for the specified netCDF dataset.<P>
<LI>The specified netCDF type is invalid.<P>
<LI>The specified length is negative.<P>
<LI>The specified open netCDF dataset is in data mode and the specified attribute would expand.<P>
<LI>The specified open netCDF dataset is in data mode and the specified attribute does not already exist.<P>
<LI>The specified netCDF ID does not refer to an open netCDF dataset.<P>
<LI>The <A NAME=MARKER-2-2951></A>number of attributes for this variable exceeds <A NAME=MARKER-10-2952></A><CODE><A NAME=MARKER-2-2953></A>NF_MAX_ATTRS</CODE>.<P>
</UL>
<A NAME=HEADING13-45></A>
<H4>Example </H4>
 Here is an example using <A NAME=MARKER-10-2954></A><CODE>NF_PUT_ATT_DOUBLE</CODE> to add a variable attribute named <CODE>valid_range</CODE> for a netCDF variable named <CODE>rh</CODE> and a global attribute named <CODE>title</CODE> to an existing netCDF dataset named <CODE>foo.nc</CODE>: <P>
<PRE>
<A NAME=MARKER-10-2955></A>INCLUDE 'netcdf.inc'
   ... 
INTEGER STATUS, NCID
INTEGER RHID                 ! variable ID
DOUBLE RHRNGE(2)
DATA RHRNGE /0.0D0, 100.0D0/
   ... 
STATUS = NF_OPEN ('foo.nc', NF_WRITE, NCID)
IF (STATUS .NE. NF_NOERR) CALL HANDLE_ERR(STATUS)
   ... 
STATUS = NF_REDEF (NCID)     ! enter define mode
IF (STATUS .NE. NF_NOERR) CALL HANDLE_ERR(STATUS)
STATUS = NF_INQ_VARID (NCID, 'rh', RHID)
IF (STATUS .NE. NF_NOERR) CALL HANDLE_ERR(STATUS)
   ... 
STATUS = NF_PUT_ATT_DOUBLE (NCID, RHID, 'valid_range', NF_DOUBLE, &amp;
                            2, RHRNGE)
IF (STATUS .NE. NF_NOERR) CALL HANDLE_ERR(STATUS)
STATUS = NF_PUT_ATT_TEXT (NCID, NF_GLOBAL, 'title', 19, 
                          'example netCDF dataset')
IF (STATUS .NE. NF_NOERR) CALL HANDLE_ERR(STATUS)
   ... 
STATUS = NF_ENDDEF (NCID)    ! leave define mode
IF (STATUS .NE. NF_NOERR) CALL HANDLE_ERR(STATUS)
</PRE>
<A NAME=HEADING13-71></A>
<H2>8.3  Get Information about an Attribute: <A NAME=MARKER-10-2956></A><CODE><A NAME=MARKER-2-2957></A>NF_INQ_ATT </CODE>Family</H2>
<HR>
 This family of functions returns <A NAME=MARKER-2-2958></A><A NAME=MARKER-2-2959></A><A NAME=MARKER-2-2960></A><A NAME=MARKER-2-2961></A><A NAME=MARKER-2-2962></A>information about a netCDF attribute. All but one of these functions require the variable ID and attribute name; the exception is<A NAME=MARKER-10-2963></A> <CODE>NF_INQ_ATTNAME</CODE>. Information about an attribute includes its type, length, name, and number. See the <A NAME=MARKER-10-2964></A><CODE>NF_GET_ATT</CODE> family for getting attribute values.<P>
  The function <A NAME=MARKER-10-2965></A><CODE>NF_INQ_ATTNAME</CODE> gets the name of an attribute, given its variable ID and number. This function is useful in <A NAME=MARKER-2-2966></A><A NAME=MARKER-2-2967></A>generic applications that need to get the names of all the attributes associated with a variable, since attributes are accessed by name rather than number in all other attribute functions. The number of an attribute is more volatile than the name, since it can change when other attributes of the same variable are deleted. This is why an attribute number is not called an <A NAME=MARKER-2-2970></A><A NAME=MARKER-2-2971></A>attribute ID. <P>
 The function <A NAME=MARKER-10-2972></A><CODE>NF_INQ_ATT</CODE> returns the attribute's type and length. The other functions each return just one item of information about an attribute.<P>
<A NAME=HEADING13-75></A>
<H4>Usage </H4>
<PRE>

<A NAME=MARKER-10-2973></A>
INTEGER FUNCTION NF_INQ_ATT    (INTEGER NCID, INTEGER VARID,
                                CHARACTER*(*) NAME, INTEGER xtype,
                                INTEGER len)
INTEGER FUNCTION <A NAME=MARKER-2-2974></A>NF_INQ_ATTTYPE(INTEGER NCID, INTEGER VARID,
                                CHARACTER*(*) NAME, INTEGER xtype)
INTEGER FUNCTION <A NAME=MARKER-2-2975></A>NF_INQ_ATTLEN (INTEGER NCID, INTEGER VARID,
                                CHARACTER*(*) NAME, INTEGER len)
INTEGER FUNCTION <A NAME=MARKER-2-2976></A>NF_INQ_ATTNAME(INTEGER NCID, INTEGER VARID,
                                INTEGER ATTNUM, CHARACTER*(*) name)
INTEGER FUNCTION <A NAME=MARKER-2-2977></A>NF_INQ_ATTID  (INTEGER NCID, INTEGER VARID,
                                CHARACTER*(*) NAME, INTEGER attnum)
<CODE>
<TABLE BORDER="1"><TD><CODE>NCID</CODE><TD>NetCDF ID, from a previous call to <CODE>NF_OPEN</CODE> or <CODE>NF_CREATE</CODE>.<TR>
<TD><CODE>VARID</CODE><TD>Variable ID of the <A NAME=MARKER-2-188></A><A NAME=MARKER-2-189></A><A NAME=MARKER-2-190></A>attribute's variable, or <CODE>NF_GLOBAL</CODE> for a global attribute.<TR>
<TD><CODE>NAME</CODE><TD>Attribute name, input except that for <CODE>NF_INQ_ATTNAME</CODE>, this is where the attribute name is returned.<TR>
<TD><CODE>xtype</CODE><TD>Returned attribute type, one of the set of predefined netCDF external data types. The valid netCDF external data types are <CODE>NF_BYTE</CODE>, <CODE>NF_CHAR</CODE>, <CODE>NF_SHORT</CODE>, <CODE>NF_INT</CODE>, <CODE>NF_FLOAT</CODE>, and <CODE>NF_DOUBLE</CODE>. <TR>
<TD><CODE>len</CODE><TD>Returned number of values currently stored in the attribute. For a string-valued attribute, this is the number of characters in the string.<TR>
<TD>attnum<TD>For <CODE>NF_INQ_ATTNAME</CODE>, the input attribute number; for <CODE>NF_INQ_ATTID</CODE>, the returned attribute number. The attributes for each variable are numbered from 1 (the first attribute) to <CODE>NATTS</CODE>, where <CODE>NATTS</CODE> is the number of attributes for the variable, as returned from a call to <CODE>NF_INQ_VARNATTS.</CODE><P>(If you already know an attribute name, knowing its number is not very useful, because accessing information about an attribute requires its name.) </TABLE>
</CODE>
</PRE>
Errors <P>
 Each function returns the value <A NAME=MARKER-10-2978></A><CODE>NF_NOERR</CODE> if no errors occurred. Otherwise, the returned status indicates an error. Possible causes of errors include:<P>
<UL>
<LI>The variable ID is invalid for the specified netCDF dataset.<P>
<LI>The specified attribute does not exist.<P>
<LI>The specified netCDF ID does not refer to an open netCDF dataset.<P>
<LI>For <A NAME=MARKER-10-2980></A><CODE>NF_INQ_ATTNAME</CODE>, the specified attribute number is negative or more than the number of attributes defined for the specified variable.<P>
</UL>
<A NAME=HEADING13-96></A>
<H4>Example </H4>
 <A NAME=MARKER-10-2981></A>Here is an example using <CODE><A NAME=MARKER-2-2982></A><A NAME=MARKER-2-2983></A>NF_INQ_ATTLEN</CODE> to inquire about the lengths of an attribute named <CODE>valid_range</CODE> for a netCDF variable named <CODE>rh</CODE> and a global attribute named <CODE>title</CODE> in an existing netCDF dataset named <CODE>foo.nc</CODE>: <P>
<PRE>
INCLUDE 'netcdf.inc'
   ... 
INTEGER STATUS, NCID
INTEGER RHID               ! variable ID
INTEGER VRLEN, TLEN        ! attribute lengths
   ... 
STATUS = NF_OPEN ('foo.nc', NF_NOWRITE, NCID)
IF (STATUS .NE. NF_NOERR) CALL HANDLE_ERR(STATUS)
   ... 
STATUS = NF_INQ_VARID (NCID, 'rh', RHID)
IF (STATUS .NE. NF_NOERR) CALL HANDLE_ERR(STATUS)
   ... 
STATUS = NF_INQ_ATTLEN (NCID, RHID, 'valid_range', VRLEN)
IF (STATUS .NE. NF_NOERR) CALL HANDLE_ERR(STATUS)
STATUS = NF_INQ_ATTLEN (NCID, NF_GLOBAL, 'title', TLEN)
IF (STATUS .NE. NF_NOERR) CALL HANDLE_ERR(STATUS)
</PRE>
<A NAME=HEADING13-114></A>
<H2>8.4  <A NAME=MARKER-2-2984></A><A NAME=MARKER-2-2985></A><A NAME=MARKER-2-2986></A>Get Attribute's Values:<A NAME=MARKER-10-2987></A> <CODE><A NAME=MARKER-2-2988></A>NF_GET_ATT_<I>type </I></CODE></H2>
<HR>
 Members of the <A NAME=MARKER-10-2989></A><CODE>NF_GET_ATT_<B>type</B></CODE> family of functions get the value(s) of a netCDF attribute, given its variable ID and name.<P>
<A NAME=HEADING13-116></A>
<H4>Usage </H4>
<PRE>
<A NAME=MARKER-10-2990></A>INTEGER FUNCTION NF_GET_ATT_TEXT   (INTEGER NCID, INTEGER VARID,
                                    CHARACTER*(*) NAME,
                                    CHARACTER*(*) text)
INTEGER FUNCTION NF_GET_ATT_INT1   (INTEGER NCID, INTEGER VARID,
                                    CHARACTER*(*) NAME,
                                    INTEGER*1 i1vals(*))
INTEGER FUNCTION NF_GET_ATT_INT2   (INTEGER NCID, INTEGER VARID,
                                    CHARACTER*(*) NAME,
                                    INTEGER*2 i2vals(*))
INTEGER FUNCTION NF_GET_ATT_INT    (INTEGER NCID, INTEGER VARID,
                                    CHARACTER*(*) NAME,
                                    INTEGER ivals(*))
INTEGER FUNCTION NF_GET_ATT_REAL   (INTEGER NCID, INTEGER VARID,
                                    CHARACTER*(*) NAME,
                                    REAL rvals(*))
INTEGER FUNCTION NF_GET_ATT_DOUBLE (INTEGER NCID, INTEGER VARID,
                                    CHARACTER*(*) NAME,
                                    DOUBLE dvals(*))
<TABLE BORDER="1"><TD><CODE>NCID</CODE><TD>NetCDF ID, from a previous call to <CODE>NF_OPEN</CODE> or <CODE>NF_CREATE</CODE>.<TR>
<TD><CODE>VARID</CODE><TD>Variable ID of the attribute's variable, or <CODE>NF_GLOBAL</CODE> for a global attribute.<TR>
<TD><CODE>NAME</CODE><TD>Attribute name.<TR>
<TD><CODE>text, i1vals, 
i2vals, ivals,rvals, or dvals</CODE><TD>Returned attribute values. All elements of the vector of attribute values are returned, so you must provide enough space to hold them. If you don't know how much space to reserve, call <CODE>NF_INQ_ATTLEN </CODE>first to find out the length of the attribute. You cannot read character data from a numeric variable or numeric data from a text variable. For numeric data, if the type of data differs from the netCDF variable type, type conversion will occur (see Section 3.3 "Type Conversion," page 24, for details). </TABLE>

</PRE>
Errors <P>
 <CODE><A NAME=MARKER-10-2991></A>NF_GET_ATT_<B>type</B></CODE> returns the value <A NAME=MARKER-10-2992></A><CODE><A NAME=MARKER-2-2993></A>NF_NOERR</CODE> if no errors occurred. Otherwise, the returned status indicates an error. Possible causes of errors include:<P>
<UL>
<LI>The variable ID is invalid for the specified netCDF dataset.<P>
<LI>The specified attribute does not exist.<P>
<LI>The specified netCDF ID does not refer to an open netCDF dataset.<P>
<LI>One or more of the attribute values are out of the range of values representable by the desired type.<P>
</UL>
<A NAME=HEADING13-141></A>
<H4>Example </H4>
 <A NAME=MARKER-10-2994></A>Here is an example using <CODE><A NAME=MARKER-2-2995></A>NF_GET_ATT_DOUBLE</CODE> to determine the values of an attribute named <CODE>valid_range</CODE> for a netCDF variable named <CODE>rh </CODE>and a global attribute named <CODE>title</CODE> in an existing netCDF dataset named <CODE>foo.nc</CODE>. In this example, it is assumed that we don't know how many values will be returned, so we first inquire about the length of the attributes to make sure we have enough space to store them: <P>
<PRE>
INCLUDE 'netcdf.inc'
   ... 
PARAMETER (MVRLEN=3)           ! max number of &quot;valid_range&quot; values
PARAMETER (MTLEN=80)           ! max length of &quot;title&quot; attribute
INTEGER STATUS, NCID
INTEGER RHID                   ! variable ID
INTEGER VRLEN, TLEN            ! attribute lengths
DOUBLE PRECISION VRVAL(MVRLEN) ! vr attribute values
CHARACTER*80 TITLE             ! title attribute values
   ... 
STATUS = NF_OPEN ('foo.nc', NF_WRITE, NCID)
IF (STATUS .NE. NF_NOERR) CALL HANDLE_ERR(STATUS)
   ... 
STATUS = NF_INQ_VARID (NCID, 'rh', RHID)
IF (STATUS .NE. NF_NOERR) CALL HANDLE_ERR(STATUS)
   ... 
! find out attribute lengths, to make sure we have enough space
STATUS = NF_INQ_ATTLEN (NCID, RHID, 'valid_range', VRLEN)
IF (STATUS .NE. NF_NOERR) CALL HANDLE_ERR(STATUS)
STATUS = NF_INQ_ATTLEN (NCID, NF_GLOBAL, 'title', TLEN)
IF (STATUS .NE. NF_NOERR) CALL HANDLE_ERR(STATUS)
! get attribute values, if not too big
IF (VRLEN .GT. MVRLEN) THEN
    WRITE (*,*) 'valid_range attribute too big!'
    CALL EXIT
ELSE
    STATUS = NF_GET_ATT_DOUBLE (NCID, RHID, 'valid_range', VRVAL)
    IF (STATUS .NE. NF_NOERR) CALL HANDLE_ERR(STATUS)
ENDIF
IF (TLEN .GT. MTLEN) THEN
    WRITE (*,*) 'title attribute too big!'
    CALL EXIT
ELSE
    STATUS = NF_GET_ATT_TEXT (NCID, NF_GLOBAL, 'title', TITLE)
    IF (STATUS .NE. NF_NOERR) CALL HANDLE_ERR(STATUS)
ENDIF
</PRE>
<A NAME=HEADING13-179></A>
<H2>8.5  <A NAME=MARKER-2-2996></A><A NAME=MARKER-2-2997></A>Copy Attribute from One NetCDF to Another: <A NAME=MARKER-10-2998></A><CODE><A NAME=MARKER-2-2999></A>NF_COPY_ATT </CODE></H2>
<HR>
 The function <A NAME=MARKER-10-3000></A><CODE>NF_COPY_ATT</CODE> copies an attribute from one open netCDF dataset to another. It can also be used to copy an attribute from one variable to another within the same netCDF. <P>
<A NAME=HEADING13-181></A>
<H4>Usage </H4>
<PRE>

<A NAME=MARKER-10-3001></A>INTEGER FUNCTION NF_COPY_ATT (INTEGER NCID_IN, INTEGER VARID_IN,
                              CHARACTER*(*) NAME, INTEGER NCID_OUT,
                              INTEGER VARID_OUT)
<TABLE BORDER="1"><TD><CODE>NCID_IN</CODE><TD>The netCDF ID of an input netCDF dataset from which the attribute will be copied, from a previous call to <CODE>NF_OPEN</CODE> or <CODE>NF_CREATE</CODE>.<TR>
<TD><CODE>VARID_IN</CODE><TD>ID of the variable in the input netCDF dataset from which the attribute will be copied, or <CODE>NF_GLOBAL</CODE> for a global attribute.<TR>
<TD><CODE>NAME</CODE><TD>Name of the attribute in the input netCDF dataset to be copied.<TR>
<TD><CODE>NCID_OUT</CODE><TD>The netCDF ID of the output netCDF dataset to which the attribute will be copied, from a previous call to <CODE>NF_OPEN</CODE> or <CODE>NF_CREATE</CODE>. It is permissible for the input and output netCDF IDs to be the same. The output netCDF dataset should be in define mode if the attribute to be copied does not already exist for the target variable, or if it would cause an existing target attribute to grow. <TR>
<TD><CODE>VARID_OUT</CODE><TD>ID of the variable in the output netCDF dataset to which the attribute will be copied, or <CODE>NF_GLOBAL</CODE> to copy to a global attribute.</TABLE>

</PRE>
Errors <P>
 <CODE><A NAME=MARKER-10-3002></A>NF_COPY_ATT</CODE> returns the value <A NAME=MARKER-10-3003></A><CODE>NF_NOERR</CODE> if no errors occurred. Otherwise, the returned status indicates an error. Possible causes of errors include:<P>
<UL>
<LI>The input or output variable ID is invalid for the specified netCDF dataset.<P>
<LI>The specified attribute does not exist.<P>
<LI>The output netCDF is not in define mode and the attribute is new for the output dataset is larger than the existing attribute.<P>
<LI>The input or output netCDF ID does not refer to an open netCDF dataset.<P>
</UL>
<A NAME=HEADING13-192></A>
<H4>Example </H4>
 Here is an example using <A NAME=MARKER-10-3005></A><CODE><A NAME=MARKER-2-3006></A>NF_COPY_ATT</CODE> to copy the variable attribute <CODE>units</CODE> from the variable <CODE>rh</CODE> in an existing netCDF dataset named <CODE>foo.nc</CODE> to the variable <CODE>avgrh</CODE> in another existing netCDF dataset named <CODE>bar.nc</CODE>, assuming that the variable <CODE>avgrh</CODE> already exists, but does not yet have a <CODE>units </CODE>attribute: <P>
<PRE>
<A NAME=MARKER-10-3007></A>INCLUDE 'netcdf.inc'
   ... 
INTEGER STATUS             ! error status
INTEGER NCID1, NCID2       ! netCDF IDs
INTEGER RHID, AVRHID       ! variable IDs
   ... 
STATUS = NF_OPEN ('foo.nc', NF_NOWRITE, NCID1)
IF (STATUS .NE. NF_NOERR) CALL HANDLE_ERR(STATUS)
STATUS = NF_OPEN ('bar.nc', NF_WRITE, NCID2)
IF (STATUS .NE. NF_NOERR) CALL HANDLE_ERR(STATUS)
   ... 
STATUS = NF_INQ_VARID (NCID1, 'rh', RHID)
IF (STATUS .NE. NF_NOERR) CALL HANDLE_ERR(STATUS)
STATUS = NF_INQ_VARID (NCID2, 'avgrh', AVRHID)
IF (STATUS .NE. NF_NOERR) CALL HANDLE_ERR(STATUS)
   ... 
STATUS = NF_REDEF (NCID2)  ! enter define mode
IF (STATUS .NE. NF_NOERR) CALL HANDLE_ERR(STATUS)
! copy variable attribute from &quot;rh&quot; to &quot;avgrh&quot;
STATUS = NF_COPY_ATT (NCID1, RHID, 'units', NCID2, AVRHID)
IF (STATUS .NE. NF_NOERR) CALL HANDLE_ERR(STATUS)
   ... 
STATUS = NF_ENDDEF (NCID2) ! leave define mode
IF (STATUS .NE. NF_NOERR) CALL HANDLE_ERR(STATUS)
</PRE>
<A NAME=HEADING13-218></A>
<H2>8.6  <A NAME=MARKER-2-3008></A><A NAME=MARKER-2-3009></A>Rename an Attribute: <A NAME=MARKER-10-3010></A><CODE><A NAME=MARKER-2-3011></A>NF_RENAME_ATT </CODE></H2>
<HR>
 The function <A NAME=MARKER-10-3012></A><CODE>NF_RENAME_ATT</CODE> changes the name of an attribute. If the new name is longer than the original name, the netCDF dataset must be in define mode. You cannot rename an attribute to have the same name as another attribute of the same variable. <P>
<A NAME=HEADING13-220></A>
<H4>Usage </H4>
<PRE>
<A NAME=MARKER-10-3013></A>INTEGER FUNCTION NF_RENAME_ATT (INTEGER NCID, INTEGER VARID,
                                CHARACTER*(*) NAME,
                                CHARACTER*(*) NEWNAME)
<TABLE BORDER="1"><TD><CODE>NCID</CODE><TD>NetCDF ID, from a previous call to <CODE>NF_OPEN</CODE> or <CODE>NF_CREATE</CODE><TR>
<TD><CODE>VARID</CODE><TD>ID of the attribute's variable, or <CODE>NF_GLOBAL</CODE> for a global attribute<TR>
<TD><CODE>NAME</CODE><TD>The current attribute name.<TR>
<TD><CODE>NEWNAME</CODE><TD>The new name to be assigned to the specified attribute. If the new name is longer than the current name, the netCDF dataset must be in define mode.</TABLE>

</PRE>
Errors <P>
 <CODE><A NAME=MARKER-10-3014></A>NF_RENAME_ATT</CODE> returns the value <A NAME=MARKER-10-3015></A><CODE>NF_NOERR</CODE> if no errors occurred. Otherwise, the returned status indicates an error. Possible causes of errors include:<P>
<UL>
<LI>The specified variable ID is not valid.<P>
<LI>The new attribute name is already in use for another attribute of the specified variable.<P>
<LI>The specified netCDF dataset is in data mode and the new name is longer than the old name.<P>
<LI>The specified attribute does not exist.<P>
<LI>The specified netCDF ID does not refer to an open netCDF dataset.<P>
</UL>
<A NAME=HEADING13-231></A>
<H4>Example </H4>
 Here is an example using <A NAME=MARKER-10-3017></A><CODE><A NAME=MARKER-2-3018></A>NF_RENAME_ATT</CODE> to rename the variable attribute <CODE>units</CODE> to <CODE>Units</CODE> for a variable <CODE>rh </CODE>in an existing netCDF dataset named <CODE>foo.nc</CODE>: <P>
<PRE>
<A NAME=MARKER-10-3019></A>INCLUDE &quot;netcdf.inc&quot;
   ... 
INTEGER STATUS   ! error status
INTEGER NCID     ! netCDF ID
INTEGER RHID     ! variable ID
   ... 
STATUS = NF_OPEN (&quot;foo.nc&quot;, NF_NOWRITE, NCID)
IF (STATUS .NE. NF_NOERR) CALL HANDLE_ERR(STATUS)
   ... 
STATUS = NF_INQ_VARID (NCID, &quot;rh&quot;, RHID)
IF (STATUS .NE. NF_NOERR) CALL HANDLE_ERR(STATUS)
   ... 
! rename attribute
STATUS = NF_RENAME_ATT (NCID, RHID, &quot;units&quot;, &quot;Units&quot;)
IF (STATUS .NE. NF_NOERR) CALL HANDLE_ERR(STATUS)
</PRE>
<A NAME=HEADING13-248></A>
<H2>8.7  <A NAME=MARKER-2-3020></A><A NAME=MARKER-2-3021></A><A NAME=MARKER-2-3022></A>Delete an Attribute: <A NAME=MARKER-10-3023></A><CODE><A NAME=MARKER-2-3024></A>NF_DEL_ATT </CODE></H2>
<HR>
 The function <A NAME=MARKER-10-3025></A><CODE>NF_DEL_ATT</CODE> deletes a netCDF attribute from an open netCDF dataset. The netCDF dataset must be in define mode. <P>
<A NAME=HEADING13-250></A>
<H4>Usage </H4>
<PRE>
<A NAME=MARKER-10-3026></A>INTEGER FUNCTION NF_DEL_ATT (INTEGER NCID, INTEGER VARID,
                             CHARACTER*(*) NAME)
<TABLE BORDER="1"><TD><CODE>NCID</CODE><TD>NetCDF ID, from a previous call to <CODE>NF_OPEN</CODE> or <CODE>NF_CREATE</CODE>.<TR>
<TD><CODE>VARID</CODE><TD>ID of the attribute's variable, or <CODE>NF_GLOBAL</CODE> for a global attribute.<TR>
<TD><CODE>NAME</CODE><TD>The original attribute name.</TABLE>

</PRE>
Errors <P>
 <CODE><A NAME=MARKER-10-3027></A>NF_DEL_ATT</CODE> returns the value <A NAME=MARKER-10-3028></A><CODE><A NAME=MARKER-2-3029></A>NF_NOERR</CODE> if no errors occurred. Otherwise, the returned status indicates an error. Possible causes of errors include:<P>
<UL>
<LI>The specified variable ID is not valid.<P>
<LI>The specified netCDF dataset is in data mode.<P>
<LI>The specified attribute does not exist.<P>
<LI>The specified netCDF ID does not refer to an open netCDF dataset.<P>
</UL>
<A NAME=HEADING13-259></A>
<H4>Example </H4>
 Here is an example using <A NAME=MARKER-10-3030></A><CODE>NF_DEL_ATT</CODE> to delete the variable attribute <CODE>Units</CODE> for a variable <CODE>rh</CODE> in an existing netCDF dataset named <CODE>foo.nc</CODE>: <P>
 <A NAME=MARKER-10-3032></A>Here is an example using <CODE><A NAME=MARKER-2-3033></A>NF_DEL_ATT</CODE> to delete the variable attribute <CODE>Units</CODE> for a variable <CODE>rh</CODE> in an existing netCDF dataset named <CODE>foo.nc</CODE>: <P>
<PRE>
INCLUDE 'netcdf.inc'
   ... 
INTEGER STATUS            ! error status
INTEGER NCID              ! netCDF ID
INTEGER RHID              ! variable ID
   ... 
STATUS = NF_OPEN ('foo.nc', NF_WRITE, NCID)
IF (STATUS .NE. NF_NOERR) CALL HANDLE_ERR(STATUS)
   ... 
STATUS = NF_INQ_VARID (NCID, 'rh', RHID)
IF (STATUS .NE. NF_NOERR) CALL HANDLE_ERR(STATUS)
   ... 
! delete attribute
STATUS = NF_REDEF (NCID)  ! enter define mode
IF (STATUS .NE. NF_NOERR) CALL HANDLE_ERR(STATUS)
STATUS = NF_DEL_ATT (NCID, RHID, 'Units')
IF (STATUS .NE. NF_NOERR) CALL HANDLE_ERR(STATUS)
STATUS = NF_ENDDEF (NCID) ! leave define mode
IF (STATUS .NE. NF_NOERR) CALL HANDLE_ERR(STATUS)
</PRE>
<!-- TOC --><DL>
<DT><A HREF="guidef-13.html#HEADING13-12"><B>8.1 </B> - Attribute Conventions</A>
<DD>
<DT><A HREF="guidef-13.html#HEADING13-14"><B>8.2 </B> - Create an Attribute:   NF_PUT_ATT_type </A>
<DD>
<DT><A HREF="guidef-13.html#HEADING13-16"><B>Usage</B> - </A>
<DD>
<DT><A HREF="guidef-13.html#HEADING13-45"><B>Example</B> - </A>
<DD>
<DT><A HREF="guidef-13.html#HEADING13-71"><B>8.3 </B> - Get Information about an Attribute: NF_INQ_ATT Family</A>
<DD>
<DT><A HREF="guidef-13.html#HEADING13-75"><B>Usage</B> - </A>
<DD>
<DT><A HREF="guidef-13.html#HEADING13-96"><B>Example</B> - </A>
<DD>
<DT><A HREF="guidef-13.html#HEADING13-114"><B>8.4 </B> - Get Attribute's Values: NF_GET_ATT_type </A>
<DD>
<DT><A HREF="guidef-13.html#HEADING13-116"><B>Usage</B> - </A>
<DD>
<DT><A HREF="guidef-13.html#HEADING13-141"><B>Example</B> - </A>
<DD>
<DT><A HREF="guidef-13.html#HEADING13-179"><B>8.5 </B> - Copy Attribute from One NetCDF to Another: NF_COPY_ATT </A>
<DD>
<DT><A HREF="guidef-13.html#HEADING13-181"><B>Usage</B> - </A>
<DD>
<DT><A HREF="guidef-13.html#HEADING13-192"><B>Example</B> - </A>
<DD>
<DT><A HREF="guidef-13.html#HEADING13-218"><B>8.6 </B> - Rename an Attribute: NF_RENAME_ATT </A>
<DD>
<DT><A HREF="guidef-13.html#HEADING13-220"><B>Usage</B> - </A>
<DD>
<DT><A HREF="guidef-13.html#HEADING13-231"><B>Example</B> - </A>
<DD>
<DT><A HREF="guidef-13.html#HEADING13-248"><B>8.7 </B> - Delete an Attribute: NF_DEL_ATT </A>
<DD>
<DT><A HREF="guidef-13.html#HEADING13-250"><B>Usage</B> - </A>
<DD>
<DT><A HREF="guidef-13.html#HEADING13-259"><B>Example</B> - </A>
<DD>
</DL>

<HR>
<ADDRESS>NetCDF User's Guide for Fortran - 4 JUN 1997</ADDRESS>
<A HREF="guidef-14.html">[Next] </A><A HREF="guidef-12.html">[Previous] </A><A HREF="guidef-1.html">[Top] </A><A HREF="guidef-3.html">[Contents] </A><A HREF="guidef-21.html">[Index] </A><A HREF="http://www.unidata.ucar.edu/packages/netcdf/">[netCDF Home Page]</A><A HREF="http://www.unidata.ucar.edu/">[Unidata Home Page]</A><P>
</BODY>