Commit df5405ce authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Set type of initialized variables to auto.

parent ed0e9674
......@@ -26,7 +26,6 @@
#include "cdo_options.h"
#include "cdo_zaxis.h"
#include "process_int.h"
#include "cdo_vlist.h"
#include "param_conversion.h"
......
......@@ -36,7 +36,6 @@
#include <cdi.h>
#include "cdo_defaultValues.h"
#define streamOpenWrite cdoOpenWrite
......
......@@ -27,13 +27,13 @@
#include <cdi.h>
#include "cdo_options.h"
#include "functs.h"
#include "process_int.h"
#include "cdo_vlist.h"
#include "param_conversion.h"
static void
fill_vars(int vlistID, std::vector<bool> &vars)
{
......
......@@ -26,9 +26,8 @@
*/
#include <cdi.h>
#include "cdo_options.h"
#include "cdo_options.h"
#include "functs.h"
#include "process_int.h"
#include "calendar.h"
......
......@@ -24,12 +24,12 @@
#include <cdi.h>
#include "cdo_options.h"
#include "functs.h"
#include "process_int.h"
#include <mpim_grid.h>
void *
Arithlat(void *process)
{
......
......@@ -17,13 +17,13 @@
#include <cdi.h>
#include "cdo_options.h"
#include "param_conversion.h"
#include "process_int.h"
#include "timer.h"
#include "util_files.h"
const char *
filetypestr(int filetype)
{
......
......@@ -21,12 +21,11 @@
#include <cdi.h>
#include "param_conversion.h"
#include "cdo_wtime.h"
#include "process_int.h"
void *
CDItest(void *process)
{
......
......@@ -17,7 +17,6 @@
#include <cdi.h>
#include "process_int.h"
#include "cdo_zaxis.h"
#include "cdo_cdiWrapper.h"
......@@ -108,9 +107,7 @@ CDIwrite(void *process)
cdoPrint("nvars : %d", nvars);
}
Varray<double> array(gridsize);
Varray<double> xvals(gridsize);
Varray<double> yvals(gridsize);
Varray<double> array(gridsize), xvals(gridsize), yvals(gridsize);
auto gridID2 = gridID;
if (gridInqType(gridID) == GRID_GME) gridID2 = gridToUnstructured(gridID, 0);
......
......@@ -347,7 +347,7 @@ CMOR_lite(void *process)
const auto streamID1 = cdoOpenRead(0);
const auto vlistID1 = cdoStreamInqVlist(streamID1);
auto vlistID2 = vlistDuplicate(vlistID1);
const auto vlistID2 = vlistDuplicate(vlistID1);
/* vlistPrint(vlistID2);*/
const auto nvars = vlistNvars(vlistID2);
......
......@@ -20,7 +20,6 @@
*/
#include "cdo_options.h"
#include "dmemory.h"
#include "process_int.h"
......@@ -127,17 +126,17 @@ CMOR_table(void *process)
{
cdoInitialize(process);
const int DUMP_CMOR_TABLE = cdoOperatorAdd("dump_cmor_table", 0, 0, nullptr);
const int CONV_CMOR_TABLE = cdoOperatorAdd("conv_cmor_table", 0, 0, nullptr);
const auto DUMP_CMOR_TABLE = cdoOperatorAdd("dump_cmor_table", 0, 0, nullptr);
const auto CONV_CMOR_TABLE = cdoOperatorAdd("conv_cmor_table", 0, 0, nullptr);
int operatorID = cdoOperatorID();
const auto operatorID = cdoOperatorID();
if (operatorArgc() != 1) cdoAbort("Too few arguments!");
const char *filename = cdoOperatorArgv(0).c_str();
if (Options::cdoVerbose) cdoPrint("Parse file: %s", filename);
FILE *fp = fopen(filename, "r");
auto fp = fopen(filename, "r");
if (fp == nullptr) cdoAbort("Open failed on: %s\n", filename);
PMList pmlist;
......
......@@ -23,7 +23,6 @@
#include <cdi.h>
#include "functs.h"
#include "process_int.h"
#include "cdo_vlist.h"
......@@ -32,6 +31,7 @@
#include "progress.h"
#include "cdo_options.h"
void *
Cat(void *process)
{
......
......@@ -21,12 +21,12 @@
#include <cdi.h>
#include "cdo_options.h"
#include "dmemory.h"
#include "process_int.h"
#include "counter.h"
struct vars_t
{
int param;
......
......@@ -69,8 +69,7 @@ Compc(void *process)
varListInit(varList, vlistID1);
const auto gridsizemax = vlistGridsizeMax(vlistID1);
Varray<double> array1(gridsizemax);
Varray<double> array2(gridsizemax);
Varray<double> array1(gridsizemax), array2(gridsizemax);
const auto streamID2 = cdoOpenWrite(1);
cdoDefVlist(streamID2, vlistID2);
......
......@@ -17,9 +17,9 @@
#include <cdi.h>
#include "process_int.h"
void *
Complextorect(void *process)
{
......@@ -63,8 +63,7 @@ Complextorect(void *process)
const auto gridsizemax = vlistGridsizeMax(vlistID1);
Varray<double> array1(2 * gridsizemax);
Varray<double> array2(gridsizemax);
Varray<double> array3(gridsizemax);
Varray<double> array2(gridsizemax), array3(gridsizemax);
int tsID = 0;
while ((nrecs = cdoStreamInqTimestep(streamID1, tsID)))
......
......@@ -56,17 +56,17 @@ Cond2(void *process)
const auto streamID2 = cdoOpenRead(1);
const auto streamID3 = cdoOpenRead(2);
int vlistID1 = cdoStreamInqVlist(streamID1);
int vlistID2 = cdoStreamInqVlist(streamID2);
int vlistID3 = cdoStreamInqVlist(streamID3);
int vlistID4 = vlistDuplicate(vlistID2);
const auto vlistID1 = cdoStreamInqVlist(streamID1);
const auto vlistID2 = cdoStreamInqVlist(streamID2);
const auto vlistID3 = cdoStreamInqVlist(streamID3);
const auto vlistID4 = vlistDuplicate(vlistID2);
int taxisID2 = vlistInqTaxis(vlistID2);
int taxisID4 = taxisDuplicate(taxisID2);
const auto taxisID2 = vlistInqTaxis(vlistID2);
const auto taxisID4 = taxisDuplicate(taxisID2);
vlistDefTaxis(vlistID4, taxisID4);
int ntsteps1 = vlistNtsteps(vlistID1);
int ntsteps2 = vlistNtsteps(vlistID2);
auto ntsteps1 = vlistNtsteps(vlistID1);
auto ntsteps2 = vlistNtsteps(vlistID2);
if (ntsteps1 == 0) ntsteps1 = 1;
if (ntsteps2 == 0) ntsteps2 = 1;
......@@ -87,15 +87,12 @@ Cond2(void *process)
const auto streamID4 = cdoOpenWrite(3);
cdoDefVlist(streamID4, vlistID4);
size_t gridsize = vlistGridsizeMax(vlistID1);
auto gridsize = vlistGridsizeMax(vlistID1);
if (filltype == FILL_REC && gridsize != gridInqSize(vlistGrid(vlistID1, 0)))
cdoAbort("Stream1 >%s< has wrong gridsize!", cdoGetStreamName(0));
Varray<double> array1(gridsize);
Varray<double> array2(gridsize);
Varray<double> array3(gridsize);
Varray<double> array4(gridsize);
Varray<double> array1(gridsize), array2(gridsize), array3(gridsize), array4(gridsize);
if (Options::cdoVerbose)
cdoPrint("Number of timesteps: file1 %d, file2 %d, file3 %d", ntsteps1, ntsteps2, vlistNtsteps(vlistID3));
......@@ -160,7 +157,7 @@ Cond2(void *process)
}
gridsize = gridInqSize(vlistInqVarGrid(vlistID2, varID));
double missval2 = vlistInqVarMissval(vlistID2, varID);
const auto missval2 = vlistInqVarMissval(vlistID2, varID);
if (recID == 0 || filltype != FILL_REC) missval1 = vlistInqVarMissval(vlistID1, varID);
for (size_t i = 0; i < gridsize; i++)
......
......@@ -24,11 +24,11 @@
#include <cdi.h>
#include "process_int.h"
#include "cdo_vlist.h"
#include "param_conversion.h"
void *
Condc(void *process)
{
......
......@@ -243,7 +243,7 @@ Consecstat(void *process)
for (varID = 0; varID < nvars; varID++)
{
const int nlevels = varList[varID].nlevels;
const auto nlevels = varList[varID].nlevels;
for (levelID = 0; levelID < nlevels; levelID++)
{
selEndOfPeriod(periods[varID][levelID], hist[varID][levelID], vars[varID][levelID], true);
......
......@@ -23,7 +23,6 @@
#include <cdi.h>
#include "dmemory.h"
#include "functs.h"
#include "process_int.h"
......
......@@ -17,9 +17,7 @@
#include <cdi.h>
#include "process_int.h"
#include "util_string.h"
#include "cdo_options.h"
......
......@@ -209,14 +209,10 @@ Derivepar(void *process)
if (tempID == -1) cdoAbort("%s not found!", var_stdname(air_temperature));
Varray<double> array(gridsize);
Varray<double> sgeopot(gridsize);
Varray<double> ps(gridsize);
Varray<double> sgeopot(gridsize), ps(gridsize);
Varray<double> temp(gridsize * nhlevf);
Varray<double> half_press(gridsize * (nhlevf + 1));
Varray<double> hum;
Varray<double> gheight;
Varray<double> hum, gheight;
if (operatorID == GHEIGHT)
{
if (humID == -1)
......@@ -227,8 +223,7 @@ Derivepar(void *process)
gheight.resize(gridsize * (nhlevf + 1));
}
Varray<double> full_press;
Varray<double> sealevelpressure;
Varray<double> full_press, sealevelpressure;
if (operatorID == SEALEVELPRESSURE)
{
full_press.resize(gridsize * nhlevf);
......
Markdown is supported
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