1 /*
2 This file is part of CDO. CDO is a collection of Operators to manipulate and analyse Climate model Data.
3
4 Author: Uwe Schulzweida
5
6 */
7
8 #include "cdo_fill.h"
9 #include "cdo_vlist.h"
10 #include "process_int.h"
11
12 void
cdo_fill_ts(int p_vlistID,Varray2D<double> & p_varData)13 cdo_fill_ts(int p_vlistID, Varray2D<double> &p_varData)
14 {
15 const auto nvars = vlistNvars(p_vlistID);
16 p_varData.resize(nvars);
17 for (int varID = 0; varID < nvars; varID++)
18 {
19 const auto gridsize = gridInqSize(vlistInqVarGrid(p_vlistID, varID));
20 const auto nlev = zaxisInqSize(vlistInqVarZaxis(p_vlistID, varID));
21 p_varData[varID].resize(nlev * gridsize);
22 }
23 }
24
25 void
cdo_fill_ts(int p_vlistID,Varray2D<double> & p_varData,Varray2D<size_t> & p_varNmiss)26 cdo_fill_ts(int p_vlistID, Varray2D<double> &p_varData, Varray2D<size_t> &p_varNmiss)
27 {
28 const auto nvars = vlistNvars(p_vlistID);
29 p_varData.resize(nvars);
30 p_varNmiss.resize(nvars);
31 for (int varID = 0; varID < nvars; varID++)
32 {
33 const auto gridsize = gridInqSize(vlistInqVarGrid(p_vlistID, varID));
34 const auto nlev = zaxisInqSize(vlistInqVarZaxis(p_vlistID, varID));
35 p_varData[varID].resize(nlev * gridsize);
36 p_varNmiss[varID].resize(nlev);
37 }
38 }
39