c_vlist_var.tex 11.9 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
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
\subsection{Get the Grid ID of a Variable: {\tt vlistInqVarGrid}}
\index{vlistInqVarGrid}
\label{vlistInqVarGrid}

The function {\tt vlistInqVarGrid} returns the grid ID of a variable.

\subsubsection*{Usage}

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

\hspace*{4mm}\begin{minipage}[]{15cm}
\begin{deflist}{\tt vlistID\ }
\item[{\tt vlistID}]
Variable list ID, from a previous call to {\htmlref{\tt vlistCreate}{vlistCreate}}
\item[{\tt varID}]
Variable identifier

\end{deflist}
\end{minipage}

\subsubsection*{Result}

{\tt vlistInqVarGrid} returns the grid ID of the variable.



\subsection{Get the Zaxis ID of a Variable: {\tt vlistInqVarZaxis}}
\index{vlistInqVarZaxis}
\label{vlistInqVarZaxis}

The function {\tt vlistInqVarZaxis} returns the zaxis ID of a variable.

\subsubsection*{Usage}

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

\hspace*{4mm}\begin{minipage}[]{15cm}
\begin{deflist}{\tt vlistID\ }
\item[{\tt vlistID}]
Variable list ID, from a previous call to {\htmlref{\tt vlistCreate}{vlistCreate}}
\item[{\tt varID}]
Variable identifier

\end{deflist}
\end{minipage}

\subsubsection*{Result}

{\tt vlistInqVarZaxis} returns the zaxis ID of the variable.



Uwe Schulzweida's avatar
Uwe Schulzweida committed
112
\subsection{Define the code number of a Variable: {\tt vlistDefVarCode}}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
113
114
115
116
117
\index{vlistDefVarCode}
\label{vlistDefVarCode}

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

Uwe Schulzweida's avatar
Uwe Schulzweida committed
118
\subsubsection*{Usage}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
119
120
121
122
123
124
125
126

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

\hspace*{4mm}\begin{minipage}[]{15cm}
\begin{deflist}{\tt vlistID\ }
\item[{\tt vlistID}]
127
Variable list ID, from a previous call to {\htmlref{\tt vlistCreate}{vlistCreate}}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
128
129
130
131
132
133
134
135
136
\item[{\tt varID}]
Variable identifier
\item[{\tt code}]
Code number

\end{deflist}
\end{minipage}


Uwe Schulzweida's avatar
Uwe Schulzweida committed
137
\subsection{Get the Code number of a Variable: {\tt vlistInqVarCode}}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
138
139
140
141
142
\index{vlistInqVarCode}
\label{vlistInqVarCode}

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

Uwe Schulzweida's avatar
Uwe Schulzweida committed
143
\subsubsection*{Usage}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
144
145
146
147
148
149
150
151

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

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

\end{deflist}
\end{minipage}

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

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



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

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

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

\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}]
180
Variable list ID, from a previous call to {\htmlref{\tt vlistCreate}{vlistCreate}}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
181
182
183
184
185
186
187
188
189
\item[{\tt varID}]
Variable identifier
\item[{\tt name}]
Name of the variable

\end{deflist}
\end{minipage}


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

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

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

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

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

\end{deflist}
\end{minipage}

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

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



Uwe Schulzweida's avatar
Uwe Schulzweida committed
220
\subsection{Define the long name of a Variable: {\tt vlistDefVarLongname}}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
221
222
223
224
225
\index{vlistDefVarLongname}
\label{vlistDefVarLongname}

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

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

\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}]
235
Variable list ID, from a previous call to {\htmlref{\tt vlistCreate}{vlistCreate}}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
236
237
238
239
240
241
242
243
244
\item[{\tt varID}]
Variable identifier
\item[{\tt longname}]
Long name of the variable

\end{deflist}
\end{minipage}


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

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

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

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

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

\end{deflist}
\end{minipage}

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

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



Uwe Schulzweida's avatar
Uwe Schulzweida committed
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
\subsection{Define the standard name of a Variable: {\tt vlistDefVarStdname}}
\index{vlistDefVarStdname}
\label{vlistDefVarStdname}

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

\subsubsection*{Usage}

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

\hspace*{4mm}\begin{minipage}[]{15cm}
\begin{deflist}{\tt vlistID\ }
\item[{\tt vlistID}]
Variable list ID, from a previous call to {\htmlref{\tt vlistCreate}{vlistCreate}}
\item[{\tt varID}]
Variable identifier
\item[{\tt stdname}]
Standard name of the variable

\end{deflist}
\end{minipage}


\subsection{Get the standard name of a Variable: {\tt vlistInqVarStdname}}
\index{vlistInqVarStdname}
\label{vlistInqVarStdname}

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

\subsubsection*{Usage}

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

\hspace*{4mm}\begin{minipage}[]{15cm}
\begin{deflist}{\tt vlistID\ }
\item[{\tt vlistID}]
Variable list ID, from a previous call to {\htmlref{\tt vlistCreate}{vlistCreate}}
\item[{\tt varID}]
Variable identifier
\item[{\tt stdname}]
Variable standard name

\end{deflist}
\end{minipage}

\subsubsection*{Result}

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



Uwe Schulzweida's avatar
Uwe Schulzweida committed
330
\subsection{Define the units of a Variable: {\tt vlistDefVarUnits}}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
331
332
333
334
335
\index{vlistDefVarUnits}
\label{vlistDefVarUnits}

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

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

\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}]
345
Variable list ID, from a previous call to {\htmlref{\tt vlistCreate}{vlistCreate}}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
346
347
348
349
350
351
352
353
354
\item[{\tt varID}]
Variable identifier
\item[{\tt units}]
Units of the variable

\end{deflist}
\end{minipage}


Uwe Schulzweida's avatar
Uwe Schulzweida committed
355
\subsection{Get the units of a Variable: {\tt vlistInqVarUnits}}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
356
357
358
359
360
\index{vlistInqVarUnits}
\label{vlistInqVarUnits}

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

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

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

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

\end{deflist}
\end{minipage}

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

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



Uwe Schulzweida's avatar
Uwe Schulzweida committed
385
\subsection{Define the data type of a Variable: {\tt vlistDefVarDatatype}}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
386
387
388
389
390
\index{vlistDefVarDatatype}
\label{vlistDefVarDatatype}

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

Uwe Schulzweida's avatar
Uwe Schulzweida committed
391
\subsubsection*{Usage}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
392
393
394
395
396
397
398
399

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

\hspace*{4mm}\begin{minipage}[]{15cm}
\begin{deflist}{\tt datatype\ }
\item[{\tt vlistID}]
400
Variable list ID, from a previous call to {\htmlref{\tt vlistCreate}{vlistCreate}}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
401
402
403
\item[{\tt varID}]
Variable identifier
\item[{\tt datatype}]
Uwe Schulzweida's avatar
Uwe Schulzweida committed
404
The data type identifier.
405
406
                    The valid {\CDI} data types are {\tt DATATYPE\_PACK8}, {\tt DATATYPE\_PACK16},
                    {\tt DATATYPE\_PACK24}, {\tt DATATYPE\_FLT32} and {\tt DATATYPE\_FLT64}.
Uwe Schulzweida's avatar
Uwe Schulzweida committed
407

Uwe Schulzweida's avatar
Uwe Schulzweida committed
408
409
410
411
412

\end{deflist}
\end{minipage}


Uwe Schulzweida's avatar
Uwe Schulzweida committed
413
\subsection{Get the data type of a Variable: {\tt vlistInqVarDatatype}}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
414
415
416
\index{vlistInqVarDatatype}
\label{vlistInqVarDatatype}

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

Uwe Schulzweida's avatar
Uwe Schulzweida committed
419
\subsubsection*{Usage}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
420
421
422
423
424
425
426
427

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

\hspace*{4mm}\begin{minipage}[]{15cm}
\begin{deflist}{\tt vlistID\ }
\item[{\tt vlistID}]
428
Variable list ID, from a previous call to {\htmlref{\tt vlistCreate}{vlistCreate}}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
429
430
431
432
433
434
\item[{\tt varID}]
Variable identifier

\end{deflist}
\end{minipage}

Uwe Schulzweida's avatar
Uwe Schulzweida committed
435
\subsubsection*{Result}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
436

Uwe Schulzweida's avatar
Uwe Schulzweida committed
437
{\tt vlistInqVarDatatype} returns an identifier to the data type of the variable.
438
439
The valid {\CDI} data types are {\tt DATATYPE\_PACK8}, {\tt DATATYPE\_PACK16}, {\tt DATATYPE\_PACK24},
{\tt DATATYPE\_FLT32} and {\tt DATATYPE\_FLT64}.
Uwe Schulzweida's avatar
Uwe Schulzweida committed
440
441
442



Uwe Schulzweida's avatar
Uwe Schulzweida committed
443
\subsection{Define the missing value of a Variable: {\tt vlistDefVarMissval}}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
444
445
446
447
448
\index{vlistDefVarMissval}
\label{vlistDefVarMissval}

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

Uwe Schulzweida's avatar
Uwe Schulzweida committed
449
\subsubsection*{Usage}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
450
451
452
453
454
455
456
457

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

\hspace*{4mm}\begin{minipage}[]{15cm}
\begin{deflist}{\tt vlistID\ }
\item[{\tt vlistID}]
458
Variable list ID, from a previous call to {\htmlref{\tt vlistCreate}{vlistCreate}}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
459
460
461
462
463
464
465
466
467
\item[{\tt varID}]
Variable identifier
\item[{\tt missval}]
Missing value

\end{deflist}
\end{minipage}


Uwe Schulzweida's avatar
Uwe Schulzweida committed
468
\subsection{Get the missing value of a Variable: {\tt vlistInqVarMissval}}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
469
470
471
472
473
\index{vlistInqVarMissval}
\label{vlistInqVarMissval}

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

Uwe Schulzweida's avatar
Uwe Schulzweida committed
474
\subsubsection*{Usage}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
475
476
477
478
479
480
481
482

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

\hspace*{4mm}\begin{minipage}[]{15cm}
\begin{deflist}{\tt vlistID\ }
\item[{\tt vlistID}]
483
Variable list ID, from a previous call to {\htmlref{\tt vlistCreate}{vlistCreate}}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
484
485
486
487
488
489
\item[{\tt varID}]
Variable identifier

\end{deflist}
\end{minipage}

Uwe Schulzweida's avatar
Uwe Schulzweida committed
490
\subsubsection*{Result}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
491
492
493

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