root/cf-conventions/tags/cf-conventions-1.0/docbooksrc/appendix-b.xml

Revision 1, 6.3 kB (checked in by halliday1, 3 years ago)

Initial import of CF Conventions document.

Line 
1 <appendix label="B" id="standard-name-table-format">
2   <title>Standard Name Table Format</title>
3   <para>
4         The CF standard name table is an XML document (i.e., its format
5         adheres to the XML 1.0
6         <biblioref linkend="xml"/> recommendation). The XML suite
7         of protocols provides a reasonable balance between human and
8         machine readability. It also provides extensive support for
9         internationalization. See the W3C <biblioref linkend="w3c"/> home page for more
10         information.
11   </para>
12   <para>
13         The document begins with a header that identifies it as an XML file:
14
15         <programlisting>
16                 <![CDATA[
17   <?xml version="1.0"?>
18                          ]]>
19         </programlisting>
20
21         Next is the <varname>standard_name_table</varname> itself, which is bracketed by the tags
22     <varname><sgmltag>&lt;standard_name_table&gt;</sgmltag></varname> and <varname><sgmltag>&lt;/standard_name_table&gt;</sgmltag></varname>.
23
24         <programlisting>
25                 <![CDATA[
26   <standard_name_table
27      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
28      xsi:noNamespaceSchemaLocation="CFStandardNameTable.xsd">
29                          ]]>
30          </programlisting>
31
32   </para>
33
34   <para>
35         The content (delimited by the <sgmltag>&lt;standard_name_table&gt;</sgmltag> tags)
36          consists of, in order,
37
38          <programlisting>
39                 <![CDATA[
40   <institution>Name of institution here ... </institution>
41   <contact>E-mail address of contact person ... </contact>
42                          ]]>
43          </programlisting>
44
45          followed by a sequence of <varname>entry</varname> elements which may optionally
46          be followed by a sequence of <varname>alias</varname> elements.
47      The <varname>entry</varname> and
48          <varname>alias</varname> elements take the following forms:
49          <programlisting>
50                 <![CDATA[
51   <entry id="an_id">
52       Define the variable whose standard_name attribute has the value "an_id". 
53   </entry>
54   <alias id="another_id">
55       Provide alias for a variable whose standard_name attribute has the
56         value "another_id".
57   </alias>
58                          ]]>
59          </programlisting>
60
61
62   </para>
63
64
65
66
67   <para>
68         The value of the <varname>id</varname> attribute appearing in the
69     <varname>entry</varname> and <varname>alias</varname>
70         tags is a case sensitive string, containing no whitespace,
71         which uniquely identifies the entry relative to the table.
72         <emphasis>This is the value used for a variable's <varname>standard_name</varname> attribute.</emphasis>
73   </para>
74
75         <para>
76                 The purpose of the <varname>entry</varname> elements are to provide
77                 definitions for the <varname>id</varname> strings. Each <varname>entry</varname> element
78                 contains the following elements:
79                 <programlisting>
80                         <![CDATA[
81   <entry id="an_id">
82     <canonical_units>Representative units for the variable ... </canonical_units>
83     <description>Description of the variable ... </description>
84   </entry>
85                         ]]>
86                 </programlisting>
87
88                 <varname>Entry</varname> elements may optionally also contain the following elements:
89                 <programlisting>
90                         <![CDATA[
91   <grib>GRIB parameter code</grib>
92   <amip>AMIP identifier string</amip>
93
94                         ]]>
95                 </programlisting>
96         </para>
97
98         <para>
99                 Not all variables have equivalent AMIP or GRIB
100                 codes. ECMWF GRIB codes start with <varname>E</varname>, NCEP codes
101                 with <varname>N</varname>. Standard codes (in the range 1-127) are not
102                 prefaced. When a variable has more than one equivalent
103                 GRIB code, the alternatives are given as a blank-separated
104                 list.
105         </para>
106
107         <para>
108                 The <varname>alias</varname> elements do not contain definitions.
109         Rather they
110                 contain the value of the <varname>id</varname> attribute
111         of an <varname>entry</varname> element
112                 that contains the sought after definition. The purpose of
113                 the <varname>alias</varname> elements are to provide a means for maintaining
114                 the table in a backwards compatible fashion. For example,
115                 if more than one <varname>id</varname> string was found to correspond to
116                 identical definitions, then the redundant definitions
117                 can be converted into aliases. It is not intended that
118                 the <varname>alias</varname> elements be used to accommodate the use of
119                 local naming conventions in the
120                 <varname>standard_name</varname>
121                 attribute
122                 strings. Each <varname>alias</varname> element contains a single element:
123                 <programlisting>
124                         <![CDATA[
125   <alias id="an_id">
126     <entry_id>Identifier of the defining entry ... </entry_id>
127   </alias>
128                         ]]>
129                 </programlisting>
130         </para>
131         <para>
132                 <example>
133                         <title>A name table containing three entries</title>
134                         <para>
135                                 <programlisting>
136                                         <![CDATA[
137   <?xml version="1.0"?>
138   <standard_name_table>
139     <institution>Program for Climate Model Diagnosis and Intercomparison</institution>
140     <contact>support@pcmdi.llnl.gov</contact>
141     <entry id="surface_air_pressure">
142       <canonical_units>Pa</canonical_units>
143       <grib>E134</grib>
144       <amip>ps</amip>
145       <description>
146           The surface called "surface" means the lower boundary of the atmosphere. 
147       </description>
148     </entry>
149     <entry id="air_pressure_at_sea_level">
150       <canonical_units>Pa</canonical_units>
151       <grib>2 E151</grib>
152       <amip>psl</amip>
153       <description>
154           Air pressure at sea level is the quantity often abbreviated
155           as MSLP or PMSL. sea_level means mean sea level, which is close
156           to the geoid in sea areas. 
157       </description>
158     </entry>
159     <alias id="mean_sea_level_pressure">
160       <entry_id>air_pressure_at_sea_level</entry_id>
161     </alias>
162   </standard_name_table>
163                                         ]]>
164                                 </programlisting>
165                         </para>
166                 </example>
167         </para>
168
169
170
171
172         <para>
173                         The definition of a variable with the <varname>standard_name</varname>
174                         attribute <varname>surface_air_pressure</varname> is found directly since
175                         the element with <varname>id="surface_air_pressure"</varname> is an
176             <varname>entry</varname> element which contains the definition.
177         </para>
178         <para>
179                 The definition of a variable with the
180                 <varname>standard_name</varname> attribute
181                 <constant>mean_sea_level_pressure</constant>
182                 is found indirectly by first finding the element with the
183                 <varname>id="mean_sea_level_pressure"</varname>,
184                 and then, since this is an alias element, by searching for the element with
185                 <varname>id="air_pressure_at_sea_level"</varname> as indicated
186         by the value of the <varname>entry_id</varname> tag.
187         </para>
188        
189         <para>
190                 It is possible that new tags may be added in the
191                 future. Any applications that parse the standard table
192                 should be written so that unrecognized tags are gracefully
193                 ignored.
194         </para>
195
196 </appendix>
Note: See TracBrowser for help on using the browser.