zaxis.c 48 KB
Newer Older
Uwe Schulzweida's avatar
Uwe Schulzweida committed
1
2
3
4
5
6
7
8
9
10
11
#if defined (HAVE_CONFIG_H)
#  include "config.h"
#endif

#include <string.h>
#include <math.h>
#include <float.h>

#include "dmemory.h"

#include "cdi.h"
12
#include "cdi_cksum.h"
13
#include "cdi_int.h"
14
#include "resource_handle.h"
15
#include "resource_unpack.h"
16
#include "varscan.h"
Deike Kleberg's avatar
Deike Kleberg committed
17
#include "namespace.h"
18
#include "serialize.h"
Uwe Schulzweida's avatar
Uwe Schulzweida committed
19

Deike Kleberg's avatar
Deike Kleberg committed
20
21
22
23
#define  LevelUp    1
#define  LevelDown  2


Uwe Schulzweida's avatar
Uwe Schulzweida committed
24
static struct {
25
  unsigned char positive;   // 1: up;  2: down
Uwe Schulzweida's avatar
Uwe Schulzweida committed
26
27
  char *name;
  char *longname;
Deike Kleberg's avatar
Deike Kleberg committed
28
  char *stdname;
29
  char *units;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
30
}
31
ZaxistypeEntry[] = {
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
  { /*  0 */ 0, "sfc",               "surface",                "",               ""},
  { /*  1 */ 0, "lev",               "generic",                "",               "level"},
  { /*  2 */ 2, "lev",               "hybrid",                 "",               "level"},
  { /*  3 */ 2, "lev",               "hybrid_half",            "",               "level"},
  { /*  4 */ 2, "lev",               "pressure",               "air_pressure",   "Pa"},
  { /*  5 */ 1, "height",            "height",                 "height",         "m"},
  { /*  6 */ 2, "depth",             "depth_below_sea",        "depth",          "m"},
  { /*  7 */ 2, "depth",             "depth_below_land",       "",               "cm"},
  { /*  8 */ 0, "lev",               "isentropic",             "",               "K"},
  { /*  9 */ 0, "lev",               "trajectory",             "",               ""},
  { /* 10 */ 1, "alt",               "altitude",               "",               "m"},
  { /* 11 */ 0, "lev",               "sigma",                  "",               "level"},
  { /* 12 */ 0, "lev",               "meansea",                "",               "level"},
  { /* 13 */ 0, "toa",               "top_of_atmosphere",      "",               ""},
  { /* 14 */ 0, "seabottom",         "sea_bottom",             "",               ""},
  { /* 15 */ 0, "atmosphere",        "atmosphere",             "",               ""},
  { /* 16 */ 0, "cloudbase",         "cloud_base",             "",               ""},
  { /* 17 */ 0, "cloudtop",          "cloud_top",              "",               ""},
  { /* 18 */ 0, "isotherm0",         "isotherm_zero",          "",               ""},
  { /* 19 */ 0, "snow",              "snow",                   "",               ""},
  { /* 20 */ 0, "lakebottom",        "lake_bottom",            "",               ""},
  { /* 21 */ 0, "sedimentbottom",    "sediment_bottom",        "",               ""},
  { /* 22 */ 0, "sedimentbottomta",  "sediment_bottom_ta",     "",               ""},
  { /* 23 */ 0, "sedimentbottomtw",  "sediment_bottom_tw",     "",               ""},
  { /* 24 */ 0, "mixlayer",          "mix_layer",              "",               ""},
57
  { /* 25 */ 0, "height",            "generalized height",     "height",         ""},
Uwe Schulzweida's avatar
Uwe Schulzweida committed
58
59
};

60
61
static int CDI_MaxZaxistype = sizeof(ZaxistypeEntry) / sizeof(ZaxistypeEntry[0]);

Uwe Schulzweida's avatar
Uwe Schulzweida committed
62
63

typedef struct {
Deike Kleberg's avatar
Deike Kleberg committed
64
  unsigned char positive;
Deike Kleberg's avatar
Deike Kleberg committed
65
66
67
68
  char     name[CDI_MAX_NAME];
  char     longname[CDI_MAX_NAME];
  char     stdname[CDI_MAX_NAME];
  char     units[CDI_MAX_NAME];
Uwe Schulzweida's avatar
Uwe Schulzweida committed
69
70
71
72
  double  *vals;
  double  *lbounds;
  double  *ubounds;
  double  *weights;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
73
  int      self;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
74
75
  int      prec;
  int      type;
76
  int      ltype;    /* GRIB level type */
Uwe Schulzweida's avatar
Uwe Schulzweida committed
77
78
79
80
  int      size;
  int      direction;
  int      vctsize;
  double  *vct;
81
  int      number;   /* Reference number to a generalized Z-axis */
82
  int      nhlev;
83
  char     uuid[17];
Uwe Schulzweida's avatar
Uwe Schulzweida committed
84
}
85
zaxis_t;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
86

Deike Kleberg's avatar
Deike Kleberg committed
87
88
89
static int    zaxisCompareP    ( void * zaxisptr1, void * zaxisptr2 );
static void   zaxisDestroyP    ( void * zaxisptr );
static void   zaxisPrintP      ( void * zaxisptr, FILE * fp );
90
91
static int    zaxisGetPackSize ( void * zaxisptr, void *context);
static void   zaxisPack        ( void * zaxisptr, void * buffer, int size, int *pos, void *context);
Deike Kleberg's avatar
Deike Kleberg committed
92
static int    zaxisTxCode      ( void );
Uwe Schulzweida's avatar
Uwe Schulzweida committed
93

Thomas Jahns's avatar
Thomas Jahns committed
94
static resOps zaxisOps = { zaxisCompareP, zaxisDestroyP, zaxisPrintP
Deike Kleberg's avatar
Deike Kleberg committed
95
                    , zaxisGetPackSize, zaxisPack, zaxisTxCode
96
};
Uwe Schulzweida's avatar
Uwe Schulzweida committed
97

98
static int  ZAXIS_Debug = 0;   /* If set to 1, debugging */
Uwe Schulzweida's avatar
Uwe Schulzweida committed
99

100
static
101
void zaxisDefaultValue ( zaxis_t *zaxisptr )
Uwe Schulzweida's avatar
Uwe Schulzweida committed
102
{
103
  zaxisptr->self        = CDI_UNDEFID;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
104
105
  zaxisptr->name[0]     = 0;
  zaxisptr->longname[0] = 0;
Deike Kleberg's avatar
Deike Kleberg committed
106
  zaxisptr->stdname[0]  = 0;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
107
108
109
110
111
112
  zaxisptr->units[0]    = 0;
  zaxisptr->vals        = NULL;
  zaxisptr->ubounds     = NULL;
  zaxisptr->lbounds     = NULL;
  zaxisptr->weights     = NULL;
  zaxisptr->type        = CDI_UNDEFID;
113
  zaxisptr->ltype       = 0;
Deike Kleberg's avatar
Deike Kleberg committed
114
115
  zaxisptr->positive    = 0;
  zaxisptr->direction   = 0;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
116
117
118
119
  zaxisptr->prec        = 0;
  zaxisptr->size        = 0;
  zaxisptr->vctsize     = 0;
  zaxisptr->vct         = NULL;
120
  zaxisptr->number      = 0;
121
  zaxisptr->nhlev       = 0;
122
  zaxisptr->uuid[0]     = 0;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
123
}
Uwe Schulzweida's avatar
Uwe Schulzweida committed
124

125

126
static
127
zaxis_t *zaxisNewEntry(void)
128
{
129
130
  zaxis_t *zaxisptr;

Uwe Schulzweida's avatar
Uwe Schulzweida committed
131
  zaxisptr = (zaxis_t*) xmalloc(sizeof(zaxis_t));
132
133

  zaxisDefaultValue ( zaxisptr );
134
135

  zaxisptr->self = reshPut (( void * ) zaxisptr, &zaxisOps );
136
137

  return (zaxisptr);
138
139
}

140
static
141
void zaxisInit(void)
Uwe Schulzweida's avatar
Uwe Schulzweida committed
142
{
143
144
  static int zaxisInitialized = 0;
  char *env;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
145

146
  if ( zaxisInitialized ) return;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
147

Thomas Jahns's avatar
Thomas Jahns committed
148
  zaxisInitialized = 1;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
149

150
151
  env = getenv("ZAXIS_DEBUG");
  if ( env ) ZAXIS_Debug = atoi(env);
Uwe Schulzweida's avatar
Uwe Schulzweida committed
152
153
}

154
155
static
void zaxis_copy(zaxis_t *zaxisptr2, zaxis_t *zaxisptr1)
Uwe Schulzweida's avatar
Uwe Schulzweida committed
156
157
158
159
{
  int zaxisID2;

  zaxisID2 = zaxisptr2->self;
160
  memcpy(zaxisptr2, zaxisptr1, sizeof(zaxis_t));
Uwe Schulzweida's avatar
Uwe Schulzweida committed
161
162
163
  zaxisptr2->self = zaxisID2;
}

164
165
static
void zaxisCheckPtr(const char *caller, int zaxisID, zaxis_t *zaxisptr)
Uwe Schulzweida's avatar
Uwe Schulzweida committed
166
167
{
  if ( zaxisptr == NULL )
168
    Errorc("zaxis %d undefined!", zaxisID);
Uwe Schulzweida's avatar
Uwe Schulzweida committed
169
170
}

171
#define  zaxis_check_ptr(zaxisID, zaxisptr)  zaxisCheckPtr(__func__, zaxisID, zaxisptr)
Uwe Schulzweida's avatar
Uwe Schulzweida committed
172

Uwe Schulzweida's avatar
Uwe Schulzweida committed
173
int zaxisSize(void)
Uwe Schulzweida's avatar
Uwe Schulzweida committed
174
{
175
  return reshCountType ( &zaxisOps );
Uwe Schulzweida's avatar
Uwe Schulzweida committed
176
177
178
179
}


/*
180
@Function  zaxisCreate
181
@Title     Create a vertical Z-axis
Uwe Schulzweida's avatar
Uwe Schulzweida committed
182

183
@Prototype int zaxisCreate(int zaxistype, int size)
Uwe Schulzweida's avatar
Uwe Schulzweida committed
184
185
@Parameter
    @Item  zaxistype  The type of the Z-axis, one of the set of predefined CDI Z-axis types.
Uwe Schulzweida's avatar
Uwe Schulzweida committed
186
                      The valid CDI Z-axis types are @func{ZAXIS_GENERIC}, @func{ZAXIS_SURFACE},
Uwe Schulzweida's avatar
Uwe Schulzweida committed
187
                      @func{ZAXIS_HYBRID}, @func{ZAXIS_SIGMA}, @func{ZAXIS_PRESSURE}, @func{ZAXIS_HEIGHT},
188
189
                      @func{ZAXIS_ISENTROPIC}, @func{ZAXIS_ALTITUDE}, @func{ZAXIS_MEANSEA}, @func{ZAXIS_TOA},
                      @func{ZAXIS_SEA_BOTTOM}, @func{ZAXIS_ATMOSPHERE}, @func{ZAXIS_CLOUD_BASE},
190
                      @func{ZAXIS_CLOUD_TOP}, @func{ZAXIS_ISOTHERM_ZERO}, @func{ZAXIS_SNOW},
191
192
                      @func{ZAXIS_LAKE_BOTTOM}, @func{ZAXIS_SEDIMENT_BOTTOM}, @func{ZAXIS_SEDIMENT_BOTTOM_TA},
                      @func{ZAXIS_SEDIMENT_BOTTOM_TW}, @func{ZAXIS_MIX_LAYER},
193
                      @func{ZAXIS_DEPTH_BELOW_SEA} and @func{ZAXIS_DEPTH_BELOW_LAND}.
Deike Kleberg's avatar
Deike Kleberg committed
194
    @Item  size       Number of levels.
Uwe Schulzweida's avatar
Uwe Schulzweida committed
195
196

@Description
197
The function @func{zaxisCreate} creates a vertical Z-axis.
Uwe Schulzweida's avatar
Uwe Schulzweida committed
198
199

@Result
200
@func{zaxisCreate} returns an identifier to the Z-axis.
Uwe Schulzweida's avatar
Uwe Schulzweida committed
201

Uwe Schulzweida's avatar
Uwe Schulzweida committed
202
@Example
203
Here is an example using @func{zaxisCreate} to create a pressure level Z-axis:
Uwe Schulzweida's avatar
Uwe Schulzweida committed
204
205
206
207

@Source
#include "cdi.h"
   ...
208
#define  nlev    5
Uwe Schulzweida's avatar
Uwe Schulzweida committed
209
   ...
210
double levs[nlev] = {101300, 92500, 85000, 50000, 20000};
Uwe Schulzweida's avatar
Uwe Schulzweida committed
211
212
int zaxisID;
   ...
213
zaxisID = zaxisCreate(ZAXIS_PRESSURE, nlev);
Uwe Schulzweida's avatar
Uwe Schulzweida committed
214
215
216
zaxisDefLevels(zaxisID, levs);
   ...
@EndSource
Uwe Schulzweida's avatar
Uwe Schulzweida committed
217
218
@EndFunction
*/
219
int zaxisCreate(int zaxistype, int size)
Uwe Schulzweida's avatar
Uwe Schulzweida committed
220
221
222
223
{
  int ilev;
  int zaxisID;
  double *vals;
224
  zaxis_t *zaxisptr;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
225

226
  if ( CDI_Debug ) Message("zaxistype=%s  levels=%d", zaxisNamePtr(zaxistype), size);
Uwe Schulzweida's avatar
Uwe Schulzweida committed
227

228
229
230
  if ( size < 0 ) Error("Negativ number of levels (%d) not allowed!", size);

  zaxisInit();
231
232

  zaxisptr = zaxisNewEntry();
Uwe Schulzweida's avatar
Uwe Schulzweida committed
233
234
235

  zaxisID = zaxisptr->self;

Uwe Schulzweida's avatar
Uwe Schulzweida committed
236
  zaxisptr->type = zaxistype;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
237
  zaxisptr->size = size;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
238

239
  if ( zaxistype > CDI_MaxZaxistype )
240
    Error("Internal problem! zaxistype > CDI_MaxZaxistype");
Uwe Schulzweida's avatar
Uwe Schulzweida committed
241

242
243
244
  zaxisDefName(zaxisID, ZaxistypeEntry[zaxistype].name);
  zaxisDefLongname(zaxisID, ZaxistypeEntry[zaxistype].longname);
  zaxisDefUnits(zaxisID, ZaxistypeEntry[zaxistype].units);
Uwe Schulzweida's avatar
Uwe Schulzweida committed
245

Deike Kleberg's avatar
Deike Kleberg committed
246
247
248
249
250
  if ( *ZaxistypeEntry[zaxistype].stdname )
    strcpy(zaxisptr->stdname, ZaxistypeEntry[zaxistype].stdname);

  zaxisptr->positive = ZaxistypeEntry[zaxistype].positive;

Uwe Schulzweida's avatar
Uwe Schulzweida committed
251
252
  vals = (double *) malloc(size*sizeof(double));

253
  for ( ilev = 0; ilev < size; ilev++ ) vals[ilev] = 0.0;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
254

Uwe Schulzweida's avatar
Uwe Schulzweida committed
255
  zaxisptr->vals = vals;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
256
257
258
259

  return (zaxisID);
}

260

261
void zaxisDestroyKernel( zaxis_t * zaxisptr )
262
263
264
{
  int id;

Deike Kleberg's avatar
Deike Kleberg committed
265
  xassert ( zaxisptr );
266
267
268

  id = zaxisptr->self;

269
  if ( zaxisptr->vals )    free ( zaxisptr->vals );
270
271
272
  if ( zaxisptr->lbounds ) free ( zaxisptr->lbounds );
  if ( zaxisptr->ubounds ) free ( zaxisptr->ubounds );
  if ( zaxisptr->weights ) free ( zaxisptr->weights );
273
  if ( zaxisptr->vct )     free ( zaxisptr->vct );
274
275
276

  free ( zaxisptr );

277
  reshRemove ( id, &zaxisOps );
278
279
}

280
281
282
283
284
285
/*
@Function  zaxisDestroy
@Title     Destroy a vertical Z-axis

@Prototype void zaxisDestroy(int zaxisID)
@Parameter
Deike Kleberg's avatar
Deike Kleberg committed
286
    @Item  zaxisID  Z-axis ID, from a previous call to @fref{zaxisCreate}.
287
288
289
290
291

@EndFunction
*/
void zaxisDestroy(int zaxisID)
{
292
  zaxis_t *zaxisptr;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
293

294
  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
295

296
  zaxisDestroyKernel ( zaxisptr );
297
298
299
}


300
static
301
void zaxisDestroyP ( void * zaxisptr )
302
{
303
  zaxisDestroyKernel (( zaxis_t * ) zaxisptr );
304
305
306
}


307
char *zaxisNamePtr(int zaxistype)
Uwe Schulzweida's avatar
Uwe Schulzweida committed
308
309
310
{
  char *name;

311
312
  if ( zaxistype >= 0 && zaxistype < CDI_MaxZaxistype )
    name = ZaxistypeEntry[zaxistype].longname;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
313
  else
314
    name = ZaxistypeEntry[ZAXIS_GENERIC].longname;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330

  return (name);
}


void zaxisName(int zaxistype, char *zaxisname)
{
  strcpy(zaxisname, zaxisNamePtr(zaxistype));
}

/*
@Function  zaxisDefName
@Title     Define the name of a Z-axis

@Prototype void zaxisDefName(int zaxisID, const char *name)
@Parameter
Deike Kleberg's avatar
Deike Kleberg committed
331
332
    @Item  zaxisID  Z-axis ID, from a previous call to @fref{zaxisCreate}.
    @Item  name     Name of the Z-axis.
Uwe Schulzweida's avatar
Uwe Schulzweida committed
333
334

@Description
335
The function @func{zaxisDefName} defines the name of a Z-axis.
Uwe Schulzweida's avatar
Uwe Schulzweida committed
336
337
338
339
340

@EndFunction
*/
void zaxisDefName(int zaxisID, const char *name)
{
341
  zaxis_t *zaxisptr;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
342

343
  if ( reshGetStatus ( zaxisID, &zaxisOps ) == RESH_CLOSED )
344
    {
345
      Warning("%s", "Operation not executed.");
346
347
348
      return;
    }

349
  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
Uwe Schulzweida's avatar
Uwe Schulzweida committed
350

351
352
  zaxis_check_ptr(zaxisID, zaxisptr);

Uwe Schulzweida's avatar
Uwe Schulzweida committed
353
  if ( name )
Uwe Schulzweida's avatar
Uwe Schulzweida committed
354
    strcpy(zaxisptr->name, name);
Uwe Schulzweida's avatar
Uwe Schulzweida committed
355
356
357
358
359
360
361
362
}

/*
@Function  zaxisDefLongname
@Title     Define the longname of a Z-axis

@Prototype void zaxisDefLongname(int zaxisID, const char *longname)
@Parameter
Deike Kleberg's avatar
Deike Kleberg committed
363
364
    @Item  zaxisID  Z-axis ID, from a previous call to @fref{zaxisCreate}.
    @Item  longname Longname of the Z-axis.
Uwe Schulzweida's avatar
Uwe Schulzweida committed
365
366

@Description
367
The function @func{zaxisDefLongname} defines the longname of a Z-axis.
Uwe Schulzweida's avatar
Uwe Schulzweida committed
368
369
370
371
372

@EndFunction
*/
void zaxisDefLongname(int zaxisID, const char *longname)
{
373
  zaxis_t *zaxisptr;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
374

375
  if ( reshGetStatus ( zaxisID, &zaxisOps ) == RESH_CLOSED )
376
    {
377
      Warning("%s", "Operation not executed.");
378
379
380
      return;
    }

381
  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
Uwe Schulzweida's avatar
Uwe Schulzweida committed
382

383
384
  zaxis_check_ptr(zaxisID, zaxisptr);

Uwe Schulzweida's avatar
Uwe Schulzweida committed
385
  if ( longname )
Uwe Schulzweida's avatar
Uwe Schulzweida committed
386
    strcpy(zaxisptr->longname, longname);
Uwe Schulzweida's avatar
Uwe Schulzweida committed
387
388
389
390
391
392
393
394
}

/*
@Function  zaxisDefUnits
@Title     Define the units of a Z-axis

@Prototype void zaxisDefUnits(int zaxisID, const char *units)
@Parameter
Deike Kleberg's avatar
Deike Kleberg committed
395
396
    @Item  zaxisID  Z-axis ID, from a previous call to @fref{zaxisCreate}.
    @Item  units    Units of the Z-axis.
Uwe Schulzweida's avatar
Uwe Schulzweida committed
397
398

@Description
399
The function @func{zaxisDefUnits} defines the units of a Z-axis.
Uwe Schulzweida's avatar
Uwe Schulzweida committed
400
401
402
403
404

@EndFunction
*/
void zaxisDefUnits(int zaxisID, const char *units)
{
405
  zaxis_t *zaxisptr;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
406

407
  if ( reshGetStatus ( zaxisID, &zaxisOps ) == RESH_CLOSED )
408
    {
409
      Warning("%s", "Operation not executed.");
410
411
412
      return;
    }

413
  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
Uwe Schulzweida's avatar
Uwe Schulzweida committed
414

415
416
  zaxis_check_ptr(zaxisID, zaxisptr);

Uwe Schulzweida's avatar
Uwe Schulzweida committed
417
  if ( units )
Uwe Schulzweida's avatar
Uwe Schulzweida committed
418
    strcpy(zaxisptr->units, units);
Uwe Schulzweida's avatar
Uwe Schulzweida committed
419
420
421
422
423
424
425
426
}

/*
@Function  zaxisInqName
@Title     Get the name of a Z-axis

@Prototype void zaxisInqName(int zaxisID, char *name)
@Parameter
Uwe Schulzweida's avatar
Uwe Schulzweida committed
427
    @Item  zaxisID  Z-axis ID, from a previous call to @fref{zaxisCreate} or @fref{vlistInqVarZaxis}.
Deike Kleberg's avatar
Deike Kleberg committed
428
    @Item  name     Name of the Z-axis. The caller must allocate space for the
Deike Kleberg's avatar
Deike Kleberg committed
429
                    returned string. The maximum possible length, in characters, of
430
                    the string is given by the predefined constant @func{CDI_MAX_NAME}.
Uwe Schulzweida's avatar
Uwe Schulzweida committed
431
432

@Description
433
The function @func{zaxisInqName} returns the name of a Z-axis.
Uwe Schulzweida's avatar
Uwe Schulzweida committed
434
435

@Result
436
@func{zaxisInqName} returns the name of the Z-axis to the parameter name.
Uwe Schulzweida's avatar
Uwe Schulzweida committed
437
438
439
440
441

@EndFunction
*/
void zaxisInqName(int zaxisID, char *name)
{
442
  zaxis_t *zaxisptr;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
443

444
  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
Uwe Schulzweida's avatar
Uwe Schulzweida committed
445

446
447
  zaxis_check_ptr(zaxisID, zaxisptr);

Uwe Schulzweida's avatar
Uwe Schulzweida committed
448
  strcpy(name, zaxisptr->name);
Uwe Schulzweida's avatar
Uwe Schulzweida committed
449
450
451
452
453
454
455
456
}

/*
@Function  zaxisInqLongname
@Title     Get the longname of a Z-axis

@Prototype void zaxisInqLongname(int zaxisID, char *longname)
@Parameter
Uwe Schulzweida's avatar
Uwe Schulzweida committed
457
    @Item  zaxisID  Z-axis ID, from a previous call to @fref{zaxisCreate} or @fref{vlistInqVarZaxis}.
Deike Kleberg's avatar
Deike Kleberg committed
458
    @Item  longname Longname of the Z-axis. The caller must allocate space for the
Deike Kleberg's avatar
Deike Kleberg committed
459
                    returned string. The maximum possible length, in characters, of
460
                    the string is given by the predefined constant @func{CDI_MAX_NAME}.
Uwe Schulzweida's avatar
Uwe Schulzweida committed
461
462

@Description
463
The function @func{zaxisInqLongname} returns the longname of a Z-axis.
Uwe Schulzweida's avatar
Uwe Schulzweida committed
464
465

@Result
466
@func{zaxisInqLongname} returns the longname of the Z-axis to the parameter longname.
Uwe Schulzweida's avatar
Uwe Schulzweida committed
467
468
469
470
471

@EndFunction
*/
void zaxisInqLongname(int zaxisID, char *longname)
{
472
  zaxis_t *zaxisptr;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
473

474
  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
Uwe Schulzweida's avatar
Uwe Schulzweida committed
475

476
477
  zaxis_check_ptr(zaxisID, zaxisptr);

Uwe Schulzweida's avatar
Uwe Schulzweida committed
478
  strcpy(longname, zaxisptr->longname);
Uwe Schulzweida's avatar
Uwe Schulzweida committed
479
480
481
482
483
484
485
486
}

/*
@Function  zaxisInqUnits
@Title     Get the units of a Z-axis

@Prototype void zaxisInqUnits(int zaxisID, char *units)
@Parameter
Uwe Schulzweida's avatar
Uwe Schulzweida committed
487
    @Item  zaxisID  Z-axis ID, from a previous call to @fref{zaxisCreate} or @fref{vlistInqVarZaxis}.
Deike Kleberg's avatar
Deike Kleberg committed
488
    @Item  units    Units of the Z-axis. The caller must allocate space for the
Deike Kleberg's avatar
Deike Kleberg committed
489
                    returned string. The maximum possible length, in characters, of
490
                    the string is given by the predefined constant @func{CDI_MAX_NAME}.
Uwe Schulzweida's avatar
Uwe Schulzweida committed
491
492

@Description
493
The function @func{zaxisInqUnits} returns the units of a Z-axis.
Uwe Schulzweida's avatar
Uwe Schulzweida committed
494
495

@Result
496
@func{zaxisInqUnits} returns the units of the Z-axis to the parameter units.
Uwe Schulzweida's avatar
Uwe Schulzweida committed
497
498
499
500
501

@EndFunction
*/
void zaxisInqUnits(int zaxisID, char *units)
{
502
  zaxis_t *zaxisptr;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
503

504
  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
Uwe Schulzweida's avatar
Uwe Schulzweida committed
505

506
507
  zaxis_check_ptr(zaxisID, zaxisptr);

Uwe Schulzweida's avatar
Uwe Schulzweida committed
508
  strcpy(units, zaxisptr->units);
Uwe Schulzweida's avatar
Uwe Schulzweida committed
509
510
511
}


Deike Kleberg's avatar
Deike Kleberg committed
512
513
514
515
516
517
518
519
520
521
522
523
void zaxisInqStdname(int zaxisID, char *stdname)
{
  zaxis_t *zaxisptr;

  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );

  zaxis_check_ptr(zaxisID, zaxisptr);

  strcpy(stdname, zaxisptr->stdname);
}


Uwe Schulzweida's avatar
Uwe Schulzweida committed
524
525
void zaxisDefPrec(int zaxisID, int prec)
{
526
  zaxis_t *zaxisptr;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
527

528
  if ( reshGetStatus ( zaxisID, &zaxisOps ) == RESH_CLOSED )
529
    {
530
      Warning("%s", "Operation not executed.");
531
532
533
      return;
    }

534
  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
Uwe Schulzweida's avatar
Uwe Schulzweida committed
535

536
  zaxis_check_ptr(zaxisID, zaxisptr);
Uwe Schulzweida's avatar
Uwe Schulzweida committed
537
538

  zaxisptr->prec = prec;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
539
540
541
542
543
}


int zaxisInqPrec(int zaxisID)
{
544
  zaxis_t *zaxisptr;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
545

546
  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
Uwe Schulzweida's avatar
Uwe Schulzweida committed
547

548
  zaxis_check_ptr(zaxisID, zaxisptr);
Uwe Schulzweida's avatar
Uwe Schulzweida committed
549

Uwe Schulzweida's avatar
Uwe Schulzweida committed
550
  return (zaxisptr->prec);
Uwe Schulzweida's avatar
Uwe Schulzweida committed
551
552
553
}


554
555
556
557
void zaxisDefPositive(int zaxisID, int positive)
{
  zaxis_t *zaxisptr;

558
  if ( reshGetStatus ( zaxisID, &zaxisOps ) == RESH_CLOSED )
559
    {
560
      Warning("%s", "Operation not executed.");
561
562
563
564
565
566
567
568
569
570
571
      return;
    }

  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );

  zaxis_check_ptr(zaxisID, zaxisptr);

  zaxisptr->positive = positive;
}


Deike Kleberg's avatar
Deike Kleberg committed
572
573
574
575
576
577
578
579
580
581
582
583
int zaxisInqPositive(int zaxisID)
{
  zaxis_t *zaxisptr;

  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );

  zaxis_check_ptr(zaxisID, zaxisptr);

  return (zaxisptr->positive);
}


584
585
void zaxisDefLtype(int zaxisID, int ltype)
{
586
  zaxis_t *zaxisptr;
587

588
  if ( reshGetStatus ( zaxisID, &zaxisOps ) == RESH_CLOSED )
589
    {
590
      Warning("%s", "Operation not executed.");
591
592
593
      return;
    }

594
  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
595

596
  zaxis_check_ptr(zaxisID, zaxisptr);
597
598
599
600
601
602
603

  zaxisptr->ltype = ltype;
}


int zaxisInqLtype(int zaxisID)
{
604
  zaxis_t *zaxisptr;
605

606
  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
607

608
  zaxis_check_ptr(zaxisID, zaxisptr);
609
610
611
612

  return (zaxisptr->ltype);
}

Uwe Schulzweida's avatar
Uwe Schulzweida committed
613
614
615
616
/*
@Function  zaxisDefLevels
@Title     Define the levels of a Z-axis

Uwe Schulzweida's avatar
Uwe Schulzweida committed
617
@Prototype void zaxisDefLevels(int zaxisID, const double *levels)
Uwe Schulzweida's avatar
Uwe Schulzweida committed
618
@Parameter
Deike Kleberg's avatar
Deike Kleberg committed
619
620
    @Item  zaxisID  Z-axis ID, from a previous call to @fref{zaxisCreate}.
    @Item  levels   All levels of the Z-axis.
Uwe Schulzweida's avatar
Uwe Schulzweida committed
621
622

@Description
623
The function @func{zaxisDefLevels} defines the levels of a Z-axis.
Uwe Schulzweida's avatar
Uwe Schulzweida committed
624
625
626

@EndFunction
*/
Uwe Schulzweida's avatar
Uwe Schulzweida committed
627
void zaxisDefLevels(int zaxisID, const double *levels)
Uwe Schulzweida's avatar
Uwe Schulzweida committed
628
629
630
631
{
  int ilev;
  int size;
  double *vals;
632
  zaxis_t *zaxisptr;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
633

634
  if ( reshGetStatus ( zaxisID, &zaxisOps ) == RESH_CLOSED )
635
    {
636
      Warning("%s", "Operation not executed.");
637
638
639
      return;
    }

640
  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
Uwe Schulzweida's avatar
Uwe Schulzweida committed
641

642
  zaxis_check_ptr(zaxisID, zaxisptr);
Uwe Schulzweida's avatar
Uwe Schulzweida committed
643

Uwe Schulzweida's avatar
Uwe Schulzweida committed
644
645
646
  size = zaxisptr->size;

  vals = zaxisptr->vals;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
647
648
649
650
651
652
653
654
655
656
657

  for ( ilev = 0; ilev < size; ilev++ )
    vals[ilev] = levels[ilev];
}

/*
@Function  zaxisDefLevel
@Title     Define one level of a Z-axis

@Prototype void zaxisDefLevel(int zaxisID, int levelID, double level)
@Parameter
Deike Kleberg's avatar
Deike Kleberg committed
658
659
660
    @Item  zaxisID  Z-axis ID, from a previous call to @fref{zaxisCreate}.
    @Item  levelID  Level identifier.
    @Item  level    Level.
Uwe Schulzweida's avatar
Uwe Schulzweida committed
661
662

@Description
663
The function @func{zaxisDefLevel} defines one level of a Z-axis.
Uwe Schulzweida's avatar
Uwe Schulzweida committed
664
665
666
667
668

@EndFunction
*/
void zaxisDefLevel(int zaxisID, int levelID, double level)
{
669
  zaxis_t *zaxisptr;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
670

671
  if ( reshGetStatus ( zaxisID, &zaxisOps ) == RESH_CLOSED )
672
    {
673
      Warning("%s", "Operation not executed.");
674
675
676
      return;
    }

677
  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
Uwe Schulzweida's avatar
Uwe Schulzweida committed
678

679
  zaxis_check_ptr(zaxisID, zaxisptr);
Uwe Schulzweida's avatar
Uwe Schulzweida committed
680

Uwe Schulzweida's avatar
Uwe Schulzweida committed
681
682
  if ( levelID >= 0 && levelID < zaxisptr->size )
    zaxisptr->vals[levelID] = level;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
683
684
}

685
686
687
688
689

void zaxisDefNlevRef(int zaxisID, const int nhlev)
{
  zaxis_t *zaxisptr;

690
  if ( reshGetStatus ( zaxisID, &zaxisOps ) == RESH_CLOSED )
691
    {
692
      Warning("%s", "Operation not executed.");
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
      return;
    }

  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );

  zaxis_check_ptr(zaxisID, zaxisptr);

  zaxisptr->nhlev = nhlev;
}


int zaxisInqNlevRef(int zaxisID)
{
  int nhlev = -1;
  zaxis_t *zaxisptr;

  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );

  zaxis_check_ptr(zaxisID, zaxisptr);

  nhlev = zaxisptr->nhlev;

  return (nhlev);
}

718
/*
719
720
@Function  zaxisDefNumber
@Title     Define the reference number for a generalized Z-axis
721

722
@Prototype void zaxisDefNumber(int zaxisID, const int number)
723
724
@Parameter
    @Item  zaxisID     Z-axis ID, from a previous call to @fref{zaxisCreate}.
725
    @Item  number      Reference number for a generalized Z-axis.
726
727

@Description
728
The function @func{zaxisDefNumber} defines the reference number for a generalized Z-axis.
729
730
731

@EndFunction
*/
732
void zaxisDefNumber(int zaxisID, const int number)
733
734
735
{
  zaxis_t *zaxisptr;

736
  if ( reshGetStatus ( zaxisID, &zaxisOps ) == RESH_CLOSED )
737
    {
738
      Warning("%s", "Operation not executed.");
739
740
741
742
743
744
745
      return;
    }

  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );

  zaxis_check_ptr(zaxisID, zaxisptr);

746
  zaxisptr->number = number;
747
748
}

749
750
751
752
753
754
/*
@Function  zaxisInqNumber
@Title     Get the reference number to a generalized Z-axis

@Prototype int zaxisInqNumber(int zaxisID)
@Parameter
Uwe Schulzweida's avatar
Uwe Schulzweida committed
755
    @Item  zaxisID  Z-axis ID, from a previous call to @fref{zaxisCreate} or @fref{vlistInqVarZaxis}.
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777

@Description
The function @func{zaxisInqNumber} returns the reference number to a generalized Z-axis.

@Result
@func{zaxisInqNumber} returns the reference number to a generalized Z-axis.
@EndFunction
*/
int zaxisInqNumber(int zaxisID)
{
  int number = -1;
  zaxis_t *zaxisptr;

  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );

  zaxis_check_ptr(zaxisID, zaxisptr);

  number = zaxisptr->number;

  return (number);
}

778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
/*
@Function  zaxisDefUUID
@Title     Define the UUID for a genralized Z-axis

@Prototype void zaxisDefUUID(int zaxisID, const char *uuid)
@Parameter
    @Item  zaxisID     Z-axis ID, from a previous call to @fref{zaxisCreate}.
    @Item  uuid        UUID for a generalized Z-axis.

@Description
The function @func{zaxisDefUUID} defines the UUID for a generalized  Z-axis.

@EndFunction
*/
void zaxisDefUUID(int zaxisID, const char *uuid)
{
  zaxis_t *zaxisptr;

796
    if ( reshGetStatus ( zaxisID, &zaxisOps ) == RESH_CLOSED )
797
    {
798
      Warning("%s", "Operation not executed.");
799
800
801
802
803
804
805
      return;
    }

  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );

  zaxis_check_ptr(zaxisID, zaxisptr);

806
  memcpy(zaxisptr->uuid, uuid, 16);
807
808
809
810
811
812

  return;
}

/*
@Function  zaxisInqUUID
813
@Title     Get the uuid to a generalized Z-axis
814

815
@Prototype void zaxisInqUUID(int zaxisID, char *uuid)
816
@Parameter
Uwe Schulzweida's avatar
Uwe Schulzweida committed
817
    @Item  zaxisID  Z-axis ID, from a previous call to @fref{zaxisCreate} or @fref{vlistInqVarZaxis}.
818
819
820
821
822

@Description
The function @func{zaxisInqUUID} returns the UUID to a generalized Z-axis.

@Result
823
@func{zaxisInqUUID} returns the UUID to a generalized Z-axis to the parameter uuid.
824
825
@EndFunction
*/
826
void zaxisInqUUID(int zaxisID, char *uuid)
827
828
829
830
831
832
833
{
  zaxis_t *zaxisptr;

  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );

  zaxis_check_ptr(zaxisID, zaxisptr);

834
  memcpy(uuid, zaxisptr->uuid, 16);
835
836
}

Uwe Schulzweida's avatar
Uwe Schulzweida committed
837
838
839
840
841
842
/*
@Function  zaxisInqLevel
@Title     Get one level of a Z-axis

@Prototype double zaxisInqLevel(int zaxisID, int levelID)
@Parameter
Uwe Schulzweida's avatar
Uwe Schulzweida committed
843
    @Item  zaxisID  Z-axis ID, from a previous call to @fref{zaxisCreate} or @fref{vlistInqVarZaxis}.
Deike Kleberg's avatar
Deike Kleberg committed
844
    @Item  levelID  Level index (range: 0 to nlevel-1).
Uwe Schulzweida's avatar
Uwe Schulzweida committed
845
846

@Description
847
The function @func{zaxisInqLevel} returns one level of a Z-axis.
Uwe Schulzweida's avatar
Uwe Schulzweida committed
848
849

@Result
850
@func{zaxisInqLevel} returns the level of a Z-axis.
Uwe Schulzweida's avatar
Uwe Schulzweida committed
851
852
853
854
855
@EndFunction
*/
double zaxisInqLevel(int zaxisID, int levelID)
{
  double level = 0;
856
  zaxis_t *zaxisptr;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
857

858
  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
Uwe Schulzweida's avatar
Uwe Schulzweida committed
859

860
  zaxis_check_ptr(zaxisID, zaxisptr);
Uwe Schulzweida's avatar
Uwe Schulzweida committed
861

Uwe Schulzweida's avatar
Uwe Schulzweida committed
862
863
  if ( levelID >= 0 && levelID < zaxisptr->size )
    level = zaxisptr->vals[levelID];
Uwe Schulzweida's avatar
Uwe Schulzweida committed
864
865
866
867
868
869
870

  return (level);
}

double zaxisInqLbound(int zaxisID, int index)
{
  double level = 0;
871
  zaxis_t *zaxisptr;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
872

873
  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
Uwe Schulzweida's avatar
Uwe Schulzweida committed
874

875
  zaxis_check_ptr(zaxisID, zaxisptr);
Uwe Schulzweida's avatar
Uwe Schulzweida committed
876

877
878
879
  if ( zaxisptr->lbounds )
    if ( index >= 0 && index < zaxisptr->size )
      level = zaxisptr->lbounds[index];
Uwe Schulzweida's avatar
Uwe Schulzweida committed
880
881
882
883
884
885
886
887

  return (level);
}


double zaxisInqUbound(int zaxisID, int index)
{
  double level = 0;
888
  zaxis_t *zaxisptr;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
889

890
  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
Uwe Schulzweida's avatar
Uwe Schulzweida committed
891

892
  zaxis_check_ptr(zaxisID, zaxisptr);
Uwe Schulzweida's avatar
Uwe Schulzweida committed
893

894
895
896
  if ( zaxisptr->ubounds )
    if ( index >= 0 && index < zaxisptr->size )
      level = zaxisptr->ubounds[index];
Uwe Schulzweida's avatar
Uwe Schulzweida committed
897
898
899
900
901
902
903

  return (level);
}


const double *zaxisInqLevelsPtr(int zaxisID)
{
904
  zaxis_t *zaxisptr;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
905

906
  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
Uwe Schulzweida's avatar
Uwe Schulzweida committed
907

908
909
  zaxis_check_ptr(zaxisID, zaxisptr);

Uwe Schulzweida's avatar
Uwe Schulzweida committed
910
  return ( zaxisptr->vals );
Uwe Schulzweida's avatar
Uwe Schulzweida committed
911
912
913
914
915
916
917
918
}

/*
@Function  zaxisInqLevels
@Title     Get all levels of a Z-axis

@Prototype void zaxisInqLevels(int zaxisID, double *levels)
@Parameter
Uwe Schulzweida's avatar
Uwe Schulzweida committed
919
    @Item  zaxisID  Z-axis ID, from a previous call to @fref{zaxisCreate} or @fref{vlistInqVarZaxis}.
Deike Kleberg's avatar
Deike Kleberg committed
920
921
    @Item  levels   Pointer to the location into which the levels are read.
                    The caller must allocate space for the returned values.
Deike Kleberg's avatar
Deike Kleberg committed
922

Uwe Schulzweida's avatar
Uwe Schulzweida committed
923
@Description
924
The function @func{zaxisInqLevels} returns all levels of a Z-axis.
Uwe Schulzweida's avatar
Uwe Schulzweida committed
925
926

@Result
927
@func{zaxisInqLevels} saves all levels to the parameter @func{levels}.
Uwe Schulzweida's avatar
Uwe Schulzweida committed
928
929
930
931
932
933
@EndFunction
*/
void zaxisInqLevels(int zaxisID, double *levels)
{
  int size;
  int i;
934
  zaxis_t *zaxisptr;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
935

936
  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
Uwe Schulzweida's avatar
Uwe Schulzweida committed
937

938
  zaxis_check_ptr(zaxisID, zaxisptr);
Uwe Schulzweida's avatar
Uwe Schulzweida committed
939
940

  size = zaxisptr->size;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
941
  for ( i = 0; i < size; i++ )
Uwe Schulzweida's avatar
Uwe Schulzweida committed
942
    levels[i] =  zaxisptr->vals[i];
Uwe Schulzweida's avatar
Uwe Schulzweida committed
943
944
945
946
947
948
949
}


int zaxisInqLbounds(int zaxisID, double *lbounds)
{
  int size = 0;
  int i;
950
  zaxis_t *zaxisptr;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
951

952
  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
Uwe Schulzweida's avatar
Uwe Schulzweida committed
953

954
  zaxis_check_ptr(zaxisID, zaxisptr);
Uwe Schulzweida's avatar
Uwe Schulzweida committed
955

Uwe Schulzweida's avatar
Uwe Schulzweida committed
956
  if ( zaxisptr->lbounds )
Uwe Schulzweida's avatar
Uwe Schulzweida committed
957
    {
Uwe Schulzweida's avatar
Uwe Schulzweida committed
958
      size = zaxisptr->size;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
959
960

      if ( lbounds )
Thomas Jahns's avatar
Thomas Jahns committed
961
962
        for ( i = 0; i < size; i++ )
          lbounds[i] =  zaxisptr->lbounds[i];
Uwe Schulzweida's avatar
Uwe Schulzweida committed
963
964
965
966
967
968
969
970
971
972
    }

  return (size);
}


int zaxisInqUbounds(int zaxisID, double *ubounds)
{
  int size = 0;
  int i;
973
  zaxis_t *zaxisptr;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
974

975
  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
Uwe Schulzweida's avatar
Uwe Schulzweida committed
976

977
  zaxis_check_ptr(zaxisID, zaxisptr);
Uwe Schulzweida's avatar
Uwe Schulzweida committed
978
979

  if ( zaxisptr->ubounds )
Uwe Schulzweida's avatar
Uwe Schulzweida committed
980
    {
Uwe Schulzweida's avatar
Uwe Schulzweida committed
981
      size = zaxisptr->size;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
982
983

      if ( ubounds )
Thomas Jahns's avatar
Thomas Jahns committed
984
985
        for ( i = 0; i < size; i++ )
          ubounds[i] =  zaxisptr->ubounds[i];
Uwe Schulzweida's avatar
Uwe Schulzweida committed
986
987
988
989
990
991
992
993
994
995
    }

  return (size);
}


int zaxisInqWeights(int zaxisID, double *weights)
{
  int size = 0;
  int i;
996
  zaxis_t *zaxisptr;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
997

998
  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
Uwe Schulzweida's avatar
Uwe Schulzweida committed
999

1000
  zaxis_check_ptr(zaxisID, zaxisptr);
For faster browsing, not all history is shown. View entire blame