forked from pacificclimate/VIC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
OutputData.h
45 lines (41 loc) · 1.71 KB
/
OutputData.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
* OutputData.h
*
* Created on: Aug 30, 2016
* Author: mfischer
*/
#ifndef OUTPUTDATA_H_
#define OUTPUTDATA_H_
#include <stdlib.h>
#include <string>
/*******************************************************
This class stores output information for one variable.
It replaces the old C out_data_struct and is more memory-safe.
*******************************************************/
class OutputData {
public:
OutputData();
~OutputData();
std::string varname;
int write; /* FALSE = don't write; TRUE = write */
// FIXME: format, type, and mult members should go away once we extricate ASCII and BINARY format output code
std::string format; /* format, when written to an ascii file;
should match the desired fprintf format specifier, e.g. %.4f */
int type; /* type, when written to a binary file;
OUT_TYPE_USINT = unsigned short int
OUT_TYPE_SINT = short int
OUT_TYPE_FLOAT = single precision floating point
OUT_TYPE_DOUBLE = double precision floating point */
float mult; /* multiplier, when written to a binary file */
int aggtype; /* type of aggregation to use;
AGG_TYPE_AVG = take average value over agg interval
AGG_TYPE_BEG = take value at beginning of agg interval
AGG_TYPE_END = take value at end of agg interval
AGG_TYPE_MAX = take maximum value over agg interval
AGG_TYPE_MIN = take minimum value over agg interval
AGG_TYPE_SUM = take sum over agg interval */
int nelem; /* number of data values */
double *data; /* array of data values */
double *aggdata; /* array of aggregated data values */
};
#endif /* OUTPUTDATA_H_ */