-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnc_data.h
54 lines (35 loc) · 865 Bytes
/
nc_data.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
46
47
48
49
50
51
52
53
#ifndef _NC_DATA_H_
#define _NC_DATA_H_
#include "grid.h"
#include "matrix.h"
#include <netcdf>
#include <vector>
using namespace std;
using namespace netCDF;
using namespace netCDF::exceptions;
class NcDataFile{
public:
NcFile dataFile;
vector<NcDim> dimVector;
string xDimName = "Nx";
string yDimName = "Ny";
string recName = "time";
string xCoordinateName = "xt";
string yCoordinateName = "yt";
NcDim xDim;
NcDim yDim;
NcDim recDim;
NcVar xtVar;
NcVar ytVar;
NcVar uVar;
//Dimensions of variable netcdf file
vector<size_t> startp;
vector<size_t> countp;
NcDataFile(){};
NcDataFile(string file_name);
void Init(string file_name);
void InitNcData(int Ny, int Nx);
void WriteCoordData(matrix & xt, matrix & yt);
void WriteNcData(matrix & A, int k);
};
#endif