c_vlist_var.tex 9.29 KB
Newer Older
Uwe Schulzweida's avatar
Uwe Schulzweida committed
1
2


Uwe Schulzweida's avatar
Uwe Schulzweida committed
3
\subsection{Define a Variable: {\tt vlistDefVar}}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
4
5
6
7
8
\index{vlistDefVar}
\label{vlistDefVar}

The function {\tt vlistDefVar} adds a new variable to vlistID.

Uwe Schulzweida's avatar
Uwe Schulzweida committed
9
\subsubsection*{Usage}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
10
11
12
13
14
15
16
17

\begin{verbatim}
    int vlistDefVar(int vlistID, int gridID, int zaxisID, int timeID);
\end{verbatim}

\hspace*{4mm}\begin{minipage}[]{15cm}
\begin{deflist}{\tt vlistID\ }
\item[{\tt vlistID}]
18
Variable list ID, from a previous call to {\htmlref{\tt vlistCreate}{vlistCreate}}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
19
\item[{\tt gridID}]
20
Grid ID, from a previous call to {\htmlref{\tt gridCreate}{gridCreate}}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
21
\item[{\tt zaxisID}]
22
Z-axis ID, from a previous call to {\htmlref{\tt zaxisCreate}{zaxisCreate}}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
23
\item[{\tt timeID}]
Uwe Schulzweida's avatar
Uwe Schulzweida committed
24
25
One of the set of predefined \CDI time identifiers.
                    The valid \CDI time identifiers are {\tt TIME\_CONSTANT} and {\tt TIME\_VARIABLE}.
Uwe Schulzweida's avatar
Uwe Schulzweida committed
26
27
28
29

\end{deflist}
\end{minipage}

Uwe Schulzweida's avatar
Uwe Schulzweida committed
30
\subsubsection*{Result}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
31
32
33
34

{\tt vlistDefVar} returns an identifier to the new variable.


Uwe Schulzweida's avatar
Uwe Schulzweida committed
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
\subsubsection*{Example}

Here is an example using {\tt vlistCreate} to create a variable list
and add a variable with {\tt vlistDefVar}.

\begin{lstlisting}[language=C, backgroundcolor=\color{zebg}, basicstyle=\footnotesize]

    #include "cdi.h"
       ...
    int vlistID, varID;
       ...
    vlistID = vlistCreate();
    varID = vlistDefVar(vlistID, gridID, zaxisID, TIME_VARIABLE);
       ...
    streamDefVlist(streamID, vlistID);
       ...
    vlistDestroy(vlistID);
       ...
\end{lstlisting}

Uwe Schulzweida's avatar
Uwe Schulzweida committed
55

Uwe Schulzweida's avatar
Uwe Schulzweida committed
56
\subsection{Define the code number of a Variable: {\tt vlistDefVarCode}}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
57
58
59
60
61
\index{vlistDefVarCode}
\label{vlistDefVarCode}

The function {\tt vlistDefVarCode} defines the code number of a variable.

Uwe Schulzweida's avatar
Uwe Schulzweida committed
62
\subsubsection*{Usage}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
63
64
65
66
67
68
69
70

\begin{verbatim}
    void vlistDefVarCode(int vlistID, int varID, int code);
\end{verbatim}

\hspace*{4mm}\begin{minipage}[]{15cm}
\begin{deflist}{\tt vlistID\ }
\item[{\tt vlistID}]
71
Variable list ID, from a previous call to {\htmlref{\tt vlistCreate}{vlistCreate}}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
72
73
74
75
76
77
78
79
80
\item[{\tt varID}]
Variable identifier
\item[{\tt code}]
Code number

\end{deflist}
\end{minipage}


Uwe Schulzweida's avatar
Uwe Schulzweida committed
81
\subsection{Get the Code number of a Variable: {\tt vlistInqVarCode}}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
82
83
84
85
86
\index{vlistInqVarCode}
\label{vlistInqVarCode}

The function {\tt vlistInqVarCode} returns the code number of a variable.

Uwe Schulzweida's avatar
Uwe Schulzweida committed
87
\subsubsection*{Usage}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
88
89
90
91
92
93
94
95

\begin{verbatim}
    int vlistInqVarCode(int vlistID, int varID);
\end{verbatim}

\hspace*{4mm}\begin{minipage}[]{15cm}
\begin{deflist}{\tt vlistID\ }
\item[{\tt vlistID}]
96
Variable list ID, from a previous call to {\htmlref{\tt vlistCreate}{vlistCreate}}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
97
98
99
100
101
102
\item[{\tt varID}]
Variable identifier

\end{deflist}
\end{minipage}

Uwe Schulzweida's avatar
Uwe Schulzweida committed
103
\subsubsection*{Result}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
104
105
106
107
108

{\tt vlistInqVarCode} returns the code number of the variable.



Uwe Schulzweida's avatar
Uwe Schulzweida committed
109
\subsection{Define the name of a Variable: {\tt vlistDefVarName}}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
110
111
112
113
114
\index{vlistDefVarName}
\label{vlistDefVarName}

The function {\tt vlistDefVarName} defines the name of a variable.

Uwe Schulzweida's avatar
Uwe Schulzweida committed
115
\subsubsection*{Usage}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
116
117
118
119
120
121
122
123

\begin{verbatim}
    void vlistDefVarName(int vlistID, int varID, const char *name);
\end{verbatim}

\hspace*{4mm}\begin{minipage}[]{15cm}
\begin{deflist}{\tt vlistID\ }
\item[{\tt vlistID}]
124
Variable list ID, from a previous call to {\htmlref{\tt vlistCreate}{vlistCreate}}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
125
126
127
128
129
130
131
132
133
\item[{\tt varID}]
Variable identifier
\item[{\tt name}]
Name of the variable

\end{deflist}
\end{minipage}


Uwe Schulzweida's avatar
Uwe Schulzweida committed
134
\subsection{Get the name of a Variable: {\tt vlistInqVarName}}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
135
136
137
138
139
\index{vlistInqVarName}
\label{vlistInqVarName}

The function {\tt vlistInqVarName} returns the name of a variable.

Uwe Schulzweida's avatar
Uwe Schulzweida committed
140
\subsubsection*{Usage}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
141
142
143
144
145
146
147
148

\begin{verbatim}
    void vlistInqVarName(int vlistID, int varID, char *name);
\end{verbatim}

\hspace*{4mm}\begin{minipage}[]{15cm}
\begin{deflist}{\tt vlistID\ }
\item[{\tt vlistID}]
149
Variable list ID, from a previous call to {\htmlref{\tt vlistCreate}{vlistCreate}}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
150
151
152
153
154
155
156
157
\item[{\tt varID}]
Variable identifier
\item[{\tt name}]
Variable name

\end{deflist}
\end{minipage}

Uwe Schulzweida's avatar
Uwe Schulzweida committed
158
\subsubsection*{Result}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
159
160
161
162
163

{\tt vlistInqVarName} returns the name of the variable to the parameter name.



Uwe Schulzweida's avatar
Uwe Schulzweida committed
164
\subsection{Define the long name of a Variable: {\tt vlistDefVarLongname}}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
165
166
167
168
169
\index{vlistDefVarLongname}
\label{vlistDefVarLongname}

The function {\tt vlistDefVarLongname} defines the long name of a variable.

Uwe Schulzweida's avatar
Uwe Schulzweida committed
170
\subsubsection*{Usage}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
171
172
173
174
175
176
177
178

\begin{verbatim}
    void vlistDefVarLongname(int vlistID, int varID, const char *longname);
\end{verbatim}

\hspace*{4mm}\begin{minipage}[]{15cm}
\begin{deflist}{\tt longname\ }
\item[{\tt vlistID}]
179
Variable list ID, from a previous call to {\htmlref{\tt vlistCreate}{vlistCreate}}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
180
181
182
183
184
185
186
187
188
\item[{\tt varID}]
Variable identifier
\item[{\tt longname}]
Long name of the variable

\end{deflist}
\end{minipage}


Uwe Schulzweida's avatar
Uwe Schulzweida committed
189
\subsection{Get the longname of a Variable: {\tt vlistInqVarLongname}}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
190
191
192
193
194
\index{vlistInqVarLongname}
\label{vlistInqVarLongname}

The function {\tt vlistInqVarLongname} returns the longname of a variable.

Uwe Schulzweida's avatar
Uwe Schulzweida committed
195
\subsubsection*{Usage}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
196
197
198
199
200
201
202
203

\begin{verbatim}
    void vlistInqVarLongname(int vlistID, int varID, char *longname);
\end{verbatim}

\hspace*{4mm}\begin{minipage}[]{15cm}
\begin{deflist}{\tt longname\ }
\item[{\tt vlistID}]
204
Variable list ID, from a previous call to {\htmlref{\tt vlistCreate}{vlistCreate}}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
205
206
207
208
209
210
211
212
\item[{\tt varID}]
Variable identifier
\item[{\tt longname}]
Variable description

\end{deflist}
\end{minipage}

Uwe Schulzweida's avatar
Uwe Schulzweida committed
213
\subsubsection*{Result}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
214
215
216
217
218

{\tt vlistInqVaeLongname} returns the longname of the variable to the parameter longname.



Uwe Schulzweida's avatar
Uwe Schulzweida committed
219
\subsection{Define the units of a Variable: {\tt vlistDefVarUnits}}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
220
221
222
223
224
\index{vlistDefVarUnits}
\label{vlistDefVarUnits}

The function {\tt vlistDefVarUnits} defines the units of a variable.

Uwe Schulzweida's avatar
Uwe Schulzweida committed
225
\subsubsection*{Usage}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
226
227
228
229
230
231
232
233

\begin{verbatim}
    void vlistDefVarUnits(int vlistID, int varID, const char *units);
\end{verbatim}

\hspace*{4mm}\begin{minipage}[]{15cm}
\begin{deflist}{\tt vlistID\ }
\item[{\tt vlistID}]
234
Variable list ID, from a previous call to {\htmlref{\tt vlistCreate}{vlistCreate}}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
235
236
237
238
239
240
241
242
243
\item[{\tt varID}]
Variable identifier
\item[{\tt units}]
Units of the variable

\end{deflist}
\end{minipage}


Uwe Schulzweida's avatar
Uwe Schulzweida committed
244
\subsection{Get the units of a Variable: {\tt vlistInqVarUnits}}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
245
246
247
248
249
\index{vlistInqVarUnits}
\label{vlistInqVarUnits}

The function {\tt vlistInqVarUnits} returns the units of a variable.

Uwe Schulzweida's avatar
Uwe Schulzweida committed
250
\subsubsection*{Usage}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
251
252
253
254
255
256
257
258

\begin{verbatim}
    void vlistInqVarUnits(int vlistID, int varID, char *units);
\end{verbatim}

\hspace*{4mm}\begin{minipage}[]{15cm}
\begin{deflist}{\tt vlistID\ }
\item[{\tt vlistID}]
259
Variable list ID, from a previous call to {\htmlref{\tt vlistCreate}{vlistCreate}}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
260
261
262
263
264
265
266
267
\item[{\tt varID}]
Variable identifier
\item[{\tt units}]
Variable units

\end{deflist}
\end{minipage}

Uwe Schulzweida's avatar
Uwe Schulzweida committed
268
\subsubsection*{Result}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
269
270
271
272
273

{\tt vlistInqVarUnits} returns the units of the variable to the parameter units.



Uwe Schulzweida's avatar
Uwe Schulzweida committed
274
\subsection{Define the data type of a Variable: {\tt vlistDefVarDatatype}}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
275
276
277
278
279
\index{vlistDefVarDatatype}
\label{vlistDefVarDatatype}

The function {\tt vlistDefVarDatatype} defines the data type of a variable.

Uwe Schulzweida's avatar
Uwe Schulzweida committed
280
\subsubsection*{Usage}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
281
282
283
284
285
286
287
288

\begin{verbatim}
    void vlistDefVarDatatype(int vlistID, int varID, int datatype);
\end{verbatim}

\hspace*{4mm}\begin{minipage}[]{15cm}
\begin{deflist}{\tt datatype\ }
\item[{\tt vlistID}]
289
Variable list ID, from a previous call to {\htmlref{\tt vlistCreate}{vlistCreate}}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
290
291
292
\item[{\tt varID}]
Variable identifier
\item[{\tt datatype}]
Uwe Schulzweida's avatar
Uwe Schulzweida committed
293
The data type identifier.
Uwe Schulzweida's avatar
Uwe Schulzweida committed
294
                    The valid \CDI data types are {\tt DATATYPE\_PACK1}, {\tt DATATYPE\_PACK2},
Uwe Schulzweida's avatar
Uwe Schulzweida committed
295
296
                    {\tt DATATYPE\_PACK3}, {\tt DATATYPE\_REAL4} and {\tt DATATYPE\_REAL8}.

Uwe Schulzweida's avatar
Uwe Schulzweida committed
297
298
299
300
301

\end{deflist}
\end{minipage}


Uwe Schulzweida's avatar
Uwe Schulzweida committed
302
\subsection{Get the data type of a Variable: {\tt vlistInqVarDatatype}}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
303
304
305
\index{vlistInqVarDatatype}
\label{vlistInqVarDatatype}

Uwe Schulzweida's avatar
Uwe Schulzweida committed
306
The function {\tt vlistInqVarDatatype} returns the data type of a variable.
Uwe Schulzweida's avatar
Uwe Schulzweida committed
307

Uwe Schulzweida's avatar
Uwe Schulzweida committed
308
\subsubsection*{Usage}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
309
310
311
312
313
314
315
316

\begin{verbatim}
    int vlistInqVarDatatype(int vlistID, int varID);
\end{verbatim}

\hspace*{4mm}\begin{minipage}[]{15cm}
\begin{deflist}{\tt vlistID\ }
\item[{\tt vlistID}]
317
Variable list ID, from a previous call to {\htmlref{\tt vlistCreate}{vlistCreate}}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
318
319
320
321
322
323
\item[{\tt varID}]
Variable identifier

\end{deflist}
\end{minipage}

Uwe Schulzweida's avatar
Uwe Schulzweida committed
324
\subsubsection*{Result}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
325

Uwe Schulzweida's avatar
Uwe Schulzweida committed
326
{\tt vlistInqVarDatatype} returns an identifier to the data type of the variable.
Uwe Schulzweida's avatar
Uwe Schulzweida committed
327
The valid \CDI data types are {\tt DATATYPE\_PACK1}, {\tt DATATYPE\_PACK2}, {\tt DATATYPE\_PACK3},
Uwe Schulzweida's avatar
Uwe Schulzweida committed
328
{\tt DATATYPE\_REAL4} and {\tt DATATYPE\_REAL8}.
Uwe Schulzweida's avatar
Uwe Schulzweida committed
329
330
331



Uwe Schulzweida's avatar
Uwe Schulzweida committed
332
\subsection{Define the missing value of a Variable: {\tt vlistDefVarMissval}}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
333
334
335
336
337
\index{vlistDefVarMissval}
\label{vlistDefVarMissval}

The function {\tt vlistDefVarMissval} defines the missing value of a variable.

Uwe Schulzweida's avatar
Uwe Schulzweida committed
338
\subsubsection*{Usage}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
339
340
341
342
343
344
345
346

\begin{verbatim}
    void vlistDefVarMissval(int vlistID, int varID, double missval);
\end{verbatim}

\hspace*{4mm}\begin{minipage}[]{15cm}
\begin{deflist}{\tt vlistID\ }
\item[{\tt vlistID}]
347
Variable list ID, from a previous call to {\htmlref{\tt vlistCreate}{vlistCreate}}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
348
349
350
351
352
353
354
355
356
\item[{\tt varID}]
Variable identifier
\item[{\tt missval}]
Missing value

\end{deflist}
\end{minipage}


Uwe Schulzweida's avatar
Uwe Schulzweida committed
357
\subsection{Get the missing value of a Variable: {\tt vlistInqVarMissval}}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
358
359
360
361
362
\index{vlistInqVarMissval}
\label{vlistInqVarMissval}

The function {\tt vlistInqVarMissval} returns the missing value of a variable.

Uwe Schulzweida's avatar
Uwe Schulzweida committed
363
\subsubsection*{Usage}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
364
365
366
367
368
369
370
371

\begin{verbatim}
    double vlistInqVarMissval(int vlistID, int varID);
\end{verbatim}

\hspace*{4mm}\begin{minipage}[]{15cm}
\begin{deflist}{\tt vlistID\ }
\item[{\tt vlistID}]
372
Variable list ID, from a previous call to {\htmlref{\tt vlistCreate}{vlistCreate}}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
373
374
375
376
377
378
\item[{\tt varID}]
Variable identifier

\end{deflist}
\end{minipage}

Uwe Schulzweida's avatar
Uwe Schulzweida committed
379
\subsubsection*{Result}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
380
381
382

{\tt vlistInqVarMissval} returns the missing value of the variable.