Commit 140a53cb authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Set type of initialized variables to auto.

parent 874ea3a2
......@@ -364,7 +364,7 @@ after_setNextDate(struct Control *globs)
}
if (nrecs == 0) break;
const int64_t vdate = taxisInqVdate(globs->taxisID);
const auto vdate = taxisInqVdate(globs->taxisID);
const int vtime = taxisInqVtime(globs->taxisID);
after_setDateTime(&globs->NextDate, vdate, vtime);
......
......@@ -4996,7 +4996,7 @@ read_record(CdoStreamID streamID, struct mapping vars[], int vlistID)
int gridID = vlistInqVarGrid(vlistID, varID);
int type = gridInqType(gridID);
size_t gridsize = gridInqSize(gridID);
auto gridsize = gridInqSize(gridID);
double *buffer = (double *) Malloc(gridsize * sizeof(double));
struct mapping *var = map_var(varID, vars);
......
......@@ -82,7 +82,7 @@ Monarith(void *process)
int tsID2 = 0;
while ((nrecs = cdoStreamInqTimestep(streamID1, tsID)))
{
int64_t vdate = taxisInqVdate(taxisID1);
auto vdate = taxisInqVdate(taxisID1);
const int yearmon1 = vdate / 100;
if (yearmon1 != yearmon2)
......
......@@ -277,7 +277,7 @@ Mrotuvb(void *process)
int gridID1 = vlistGrid(vlistID1, 0);
int gridID2 = vlistGrid(vlistID2, 0);
const size_t gridsize = gridInqSize(gridID1);
const auto gridsize = gridInqSize(gridID1);
if (gpint && gridID1 == gridID2) cdoAbort("Input grids are the same, use parameter >noint< to disable interpolation!");
if (!gpint && gridID1 != gridID2) cdoAbort("Input grids are not the same!");
if (gridsize != gridInqSize(gridID2)) cdoAbort("Grids have different size!");
......
......@@ -70,7 +70,7 @@ Recttocomplex(void *process)
cdoInqRecord(streamID2, &varID, &levelID);
const size_t gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
const auto gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
cdoReadRecord(streamID1, array1.data(), &nmiss);
cdoReadRecord(streamID2, array2.data(), &nmiss);
......
......@@ -972,7 +972,7 @@ Remap(void *argument)
const auto gridID1 = vlistInqVarGrid(vlistID1, varID);
const auto missval = vlistInqVarMissval(vlistID1, varID);
size_t gridsize = gridInqSize(gridID1);
auto gridsize = gridInqSize(gridID1);
bool skipVar = false;
if (!remapgrids[vlistGridIndex(vlistID1, gridID1)])
......
......@@ -106,7 +106,7 @@ Replacevalues(void *process)
cdoInqRecord(streamID1, &varID, &levelID);
cdoReadRecord(streamID1, array.data(), &nmiss);
const size_t gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
const auto gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
const double missval = vlistInqVarMissval(vlistID1, varID);
if (operatorID == SETVALS)
......
......@@ -107,7 +107,7 @@ Runpctl(void *process)
{
if (vlistInqVarTimetype(vlistID1, varID) == TIME_CONSTANT) continue;
const size_t gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
const auto gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
const int nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
const double missval = vlistInqVarMissval(vlistID1, varID);
......
......@@ -75,7 +75,7 @@ Seascount(void *process)
bool newseas = false;
while ((nrecs = cdoStreamInqTimestep(streamID1, tsID)))
{
const int64_t vdate = taxisInqVdate(taxisID1);
const auto vdate = taxisInqVdate(taxisID1);
const int vtime = taxisInqVtime(taxisID1);
cdiDecodeDate(vdate, &year, &month, &day);
......
......@@ -218,7 +218,7 @@ Selgridcell(void *process)
gridID1 = vlistGrid(vlistID1, index);
gridtype = gridInqType(gridID1);
const size_t gridsize = gridInqSize(gridID1);
const auto gridsize = gridInqSize(gridID1);
if (gridsize == 1) continue;
if (indmax >= (int) gridsize)
{
......
......@@ -95,7 +95,7 @@ Selyearidx(void *process)
int nrecs = cdoStreamInqTimestep(streamID1, tsID);
if (nrecs == 0) break;
int64_t vdate = taxisInqVdate(taxisID1);
auto vdate = taxisInqVdate(taxisID1);
cdiDecodeDate(vdate, &year, &month, &day);
int year1 = year;
......
......@@ -116,7 +116,7 @@ Setbox(void *process)
cdoDefVlist(streamID2, vlistID2);
const size_t gridsize = gridInqSize(gridID);
const auto gridsize = gridInqSize(gridID);
std::vector<double> array(gridsize);
int tsID = 0;
......
......@@ -469,7 +469,7 @@ Sethalo(void *process)
const auto streamID2 = cdoOpenWrite(1);
cdoDefVlist(streamID2, vlistID2);
const size_t gridsize = gridInqSize(gridID1);
const auto gridsize = gridInqSize(gridID1);
std::vector<double> array1(gridsize);
const size_t gridsize2 = gridInqSize(gridID2);
......
......@@ -264,7 +264,7 @@ Shiftxy(void *process)
if (vars[varID])
{
const int gridID1 = vlistInqVarGrid(vlistID1, varID);
const size_t gridsize = gridInqSize(gridID1);
const auto gridsize = gridInqSize(gridID1);
const double missval = vlistInqVarMissval(vlistID2, varID);
const size_t nx = gridInqXsize(gridID1);
......
......@@ -113,7 +113,7 @@ Sorttimestamp(void *process)
{
cdoInqRecord(streamID1, &varID, &levelID);
gridID = vlistInqVarGrid(vlistID1, varID);
const size_t gridsize = gridInqSize(gridID);
const auto gridsize = gridInqSize(gridID);
vars[xtsID][varID][levelID].resize(gridsize);
cdoReadRecord(streamID1, vars[xtsID][varID][levelID].vec.data(), &nmiss);
vars[xtsID][varID][levelID].nmiss = nmiss;
......
......@@ -89,7 +89,7 @@ Timcount(void *process)
int nsets = 0;
while ((nrecs = cdoStreamInqTimestep(streamID1, tsID)))
{
const int64_t vdate = taxisInqVdate(taxisID1);
const auto vdate = taxisInqVdate(taxisID1);
const int vtime = taxisInqVtime(taxisID1);
if (nsets == 0) SET_DATE(indate2, vdate, vtime);
......
......@@ -98,7 +98,7 @@ Tstepcount(void *process)
{
cdoInqRecord(streamID1, &varID, &levelID);
gridID = vlistInqVarGrid(vlistID1, varID);
const size_t gridsize = gridInqSize(gridID);
const auto gridsize = gridInqSize(gridID);
vars[tsID][varID][levelID].resize(gridsize);
cdoReadRecord(streamID1, vars[tsID][varID][levelID].vec.data(), &nmiss);
vars[tsID][varID][levelID].nmiss = nmiss;
......@@ -116,7 +116,7 @@ Tstepcount(void *process)
{
gridID = vlistInqVarGrid(vlistID1, varID);
double missval = vlistInqVarMissval(vlistID1, varID);
size_t gridsize = gridInqSize(gridID);
auto gridsize = gridInqSize(gridID);
const int nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
for (levelID = 0; levelID < nlevels; levelID++)
{
......
......@@ -157,7 +157,7 @@ static void
remap_nn_reg2d_nonreg2d(const size_t nx, const size_t ny, const double *restrict data, const int gridID, double *restrict array)
{
int gridID2 = gridID;
const size_t gridsize = gridInqSize(gridID2);
const auto gridsize = gridInqSize(gridID2);
std::vector<double> xvals(gridsize), yvals(gridsize);
if (gridInqType(gridID2) == GRID_GME || gridInqType(gridID2) == GRID_GAUSSIAN_REDUCED) gridID2 = gridToUnstructured(gridID2, 0);
......@@ -423,7 +423,7 @@ Vargen(void *process)
cdoDefVlist(streamID, vlistID);
const size_t gridsize = gridInqSize(gridID);
const auto gridsize = gridInqSize(gridID);
std::vector<double> array(gridsize);
if (operatorID == SEQ)
......
......@@ -38,7 +38,7 @@ checkUniqueGridsize(int vlistID)
{
const int ngrids = vlistNgrids(vlistID);
const int gridID = vlistGrid(vlistID, 0);
const size_t gridsize = gridInqSize(gridID);
const auto gridsize = gridInqSize(gridID);
for (int index = 0; index < ngrids; index++)
{
if (gridsize != gridInqSize(vlistGrid(vlistID, index))) cdoAbort("Horizontal gridsize differ!");
......@@ -125,7 +125,7 @@ Varsstat(void *process)
checkUniqueGridsize(vlistID1);
const int gridID = vlistGrid(vlistID1, 0);
const size_t gridsize = gridInqSize(gridID);
const auto gridsize = gridInqSize(gridID);
const int timetype = vlistInqVarTimetype(vlistID1, 0);
const int nvars = vlistNvars(vlistID1);
......
......@@ -682,7 +682,7 @@ Verifygrid(void *argument)
}
}
size_t gridsize = gridInqSize(gridID);
auto gridsize = gridInqSize(gridID);
if (lgeo)
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment