taxis.h 2.12 KB
Newer Older
Uwe Schulzweida's avatar
Uwe Schulzweida committed
1
2
3
#ifndef _TAXIS_H
#define _TAXIS_H

4
5
#include <stdbool.h>

Uwe Schulzweida's avatar
Uwe Schulzweida committed
6
#ifndef RESOURCE_HANDLE_H
7
#include "resource_handle.h"
Uwe Schulzweida's avatar
Uwe Schulzweida committed
8
#endif
Uwe Schulzweida's avatar
Uwe Schulzweida committed
9
10

typedef struct {
11
12
  /* Date format  YYYYMMDD */
  /* Time format    hhmmss */
Uwe Schulzweida's avatar
Uwe Schulzweida committed
13
  int     self;
14
  bool    used;
15
  short   has_bounds;
16
  int     datatype;       // datatype
17
18
19
20
21
22
23
  int     type;           // time type
  int     vdate;          // verification date
  int     vtime;          // verification time
  int     rdate;          // reference date
  int     rtime;          // reference time
  int     fdate;          // forecast reference date
  int     ftime;          // forecast reference time
Uwe Schulzweida's avatar
Uwe Schulzweida committed
24
  int     calendar;
25
  int     unit;           // time unit
Uwe Schulzweida's avatar
Uwe Schulzweida committed
26
  int     numavg;
27
  bool    climatology;
28
29
30
31
  int     vdate_lb;       // lower bounds of vdate
  int     vtime_lb;       // lower bounds of vtime
  int     vdate_ub;       // upper bounds of vdate
  int     vtime_ub;       // upper bounds of vtime
32
33
  int     fc_unit;        // forecast time unit
  double  fc_period;      // forecast time period
34
35
  char   *name;
  char   *longname;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
36
}
37
taxis_t;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
38

39
40
41
void     ptaxisInit(taxis_t* taxis);
void     ptaxisCopy(taxis_t* dest, taxis_t* source);
taxis_t* taxisPtr(int taxisID);
42
void     cdiSetForecastPeriod(double timevalue, taxis_t *taxis);
43
44
45
46
void     cdiDecodeTimeval(double timevalue, taxis_t* taxis, int* date, int* time);
double   cdiEncodeTimeval(int date, int time, taxis_t* taxis);
void     timeval2vtime(double timevalue, taxis_t* taxis, int* vdate, int* vtime);
double   vtime2timeval(int vdate, int vtime, taxis_t *taxis);
Uwe Schulzweida's avatar
Uwe Schulzweida committed
47

48
void    ptaxisDefDatatype(taxis_t *taxisptr, int datatype);
49
50
51
void    ptaxisDefName(taxis_t *taxisptr, const char *name);
void    ptaxisDefLongname(taxis_t *taxisptr, const char *name);
void    taxisDestroyKernel(taxis_t *taxisptr);
52
#if !defined (SX)
53
extern const resOps taxisOps;
54
#endif
55

Thomas Jahns's avatar
Thomas Jahns committed
56
int
57
58
taxisUnpack(char *unpackBuffer, int unpackBufferSize, int *unpackBufferPos,
            int originNamespace, void *context, int checkForSameID);
Uwe Schulzweida's avatar
Uwe Schulzweida committed
59
60

#endif  /* _TAXIS_H */
61
62
63
64
65
66
67
68
69
/*
 * Local Variables:
 * c-file-style: "Java"
 * c-basic-offset: 2
 * indent-tabs-mode: nil
 * show-trailing-whitespace: t
 * require-trailing-newline: t
 * End:
 */