source: LMDZ6/trunk/tools/netcdf95/docs/Detailed_content/attributes.md @ 5303

Last change on this file since 5303 was 4918, checked in by Laurent Fairhead, 6 months ago

Reintegrated NetCDF95 in LMDZ so that it is compiled and made available by the makelmdz_fcm script.
The makelmdz_fcm creates the libnetcdf95 library and copies it in the tools/netcdf/lib directory, copying
the mod files in the tools/netcdf/include library.

File size: 3.1 KB
Line 
1Attributes
2===
3
4This page describles procedures handling NetCDF attributes.
5
6See the [improvements page](improvements.md) for an explanation of
7the mnemonics "basic change", "interface change", "functionality
8change", "additional procedure".
9
10`nf95_copy_att`
11---
12
13(basic change)
14
15      subroutine nf95_copy_att(ncid_in, varid_in, name, ncid_out, varid_out, ncerr)
16        integer, intent( in):: ncid_in,  varid_in
17        character(len=*), intent( in):: name
18        integer, intent( in):: ncid_out, varid_out
19        integer, intent(out), optional:: ncerr
20
21Reference:
22[`nf90_copy_att`](https://docs.unidata.ucar.edu/netcdf-fortran/current/f90-attributes.html#f90-copy-attribute-from-one-netcdf-to-another-nf90_copy_att)
23
24`nf95_get_att`
25---
26
27(functionality change)
28
29      subroutine nf95_get_att(ncid, varid, name, values, ncerr)
30        integer,                          intent( in) :: ncid, varid
31        character(len = *),               intent( in) :: name
32        character(len = *), integer or real(any kind), intent(out) :: values
33        integer, intent(out), optional:: ncerr
34
35`nf95_get_att` is more secure than `nf90_get_att`. For an argument
36`values` of type `character`, `nf95_get_att` checks that the `values`
37argument is long enough and removes the null terminator, if any. For a
38numeric scalar `values` argument, `nf95_get_att` checks that the
39attribute contains a single value.
40
41Reference:
42[`nf90_get_att`](https://docs.unidata.ucar.edu/netcdf-fortran/current/f90-attributes.html#f90-get-attributes-values-nf90_get_att)
43
44`nf95_get_missing`
45---
46
47(additional procedure)
48
49```
50subroutine nf95_get_missing(ncid, varid, missing)
51
52  integer, intent(in)::  ncid, varid
53 
54  real or double precision or integer or character, intent(out):: missing
55  ! missing or fill value
56```
57
58Returns the `missing_value` attribute if present, else the `_FillValue`
59if present, else `nf90_fill_real` or `nf90_fill_double`.
60
61`nf95_inquire_attribute`
62---
63
64(interface change)
65
66```
67subroutine nf95_inquire_attribute(ncid, varid, name, xtype, nclen, attnum, &
68     ncerr)
69
70  integer, intent( in)     :: ncid, varid
71  character (len = *), intent( in)     :: name
72  integer, intent(out), optional :: xtype, nclen, attnum
73  integer, intent(out), optional:: ncerr
74```
75
76The argument for the number of values or characters of the attribute is
77called `nclen` in `nf95_inquire_attribute`, instead of `len` in
78`nf90_inquire_attribute`. `len` is not a good choice for a variable name
79because it is the name of a Fortran intrinsic procedure.
80
81Reference:
82[`nf90_inquire_attribute`](https://docs.unidata.ucar.edu/netcdf-fortran/current/f90-attributes.html#f90-get-information-about-an-attribute-nf90_inquire_attribute-and-nf90_inq_attname)
83
84`nf95_put_att`
85---
86
87(basic change)
88
89```
90subroutine nf95_put_att(ncid, varid, name, values, ncerr)
91  integer, intent(in) :: ncid, varid
92  character(len = *), intent(in) :: name
93  character(len = *) or integer(any kind) or real(any kind), intent(in) :: values
94  integer, intent(out), optional:: ncerr
95```
96
97Reference:
98[`nf90_put_att`](https://docs.unidata.ucar.edu/netcdf-fortran/current/f90-attributes.html#f90-create-an-attribute-nf90_put_att)
Note: See TracBrowser for help on using the repository browser.