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

clang-format.

parent 871354a8
......@@ -35,7 +35,6 @@
#include "cdo_int.h"
#include "cdo_task.h"
#define streamOpenWrite cdoStreamOpenWrite
#define streamDefVlist cdoDefVlist
#define streamDefTimestep cdoDefTimestep
......@@ -51,7 +50,6 @@
#include <omp.h>
#endif
int scan_par_obsolate(char *namelist, const char *name, int def);
void scan_code(char *namelist, struct Variable *vars, int maxCodes, int *numCodes);
int scan_par(int verbose, char *namelist, const char *name, int def);
......@@ -280,7 +278,7 @@ after_SwitchFile(struct Control *globs)
globs->Multi--;
}
if (globs->Nfiles > 0) ifile = (char*) ifiles[--globs->Nfiles];
if (globs->Nfiles > 0) ifile = (char *) ifiles[--globs->Nfiles];
fprintf(stderr, " Continuation file: %s\n", ifile);
......@@ -1856,8 +1854,9 @@ after_processing(struct Control *globs, struct Variable *vars)
else
filename++;
if (globs->Type >= 30 && globs->Type < 50 && (vars[DIVERGENCE].selected || vars[VELOPOT].selected || vars[VORTICITY].selected
|| vars[STREAM].selected || globs->AnalysisData))
if (globs->Type >= 30 && globs->Type < 50
&& (vars[DIVERGENCE].selected || vars[VELOPOT].selected || vars[VORTICITY].selected || vars[STREAM].selected
|| globs->AnalysisData))
{
/*
int newtype = 0;
......@@ -1915,7 +1914,7 @@ after_processing(struct Control *globs, struct Variable *vars)
if (globs->ostreamID != CDI_UNDEFID) cdoStreamClose(globs->ostreamID);
processDefVarNum(vlistNvars(globs->ivlistID));
processSelf().addNvals((int)streamNvals(globs->istreamID));
processSelf().addNvals((int) streamNvals(globs->istreamID));
streamClose(globs->istreamID);
......
......@@ -33,7 +33,6 @@
#include "cdo_int.h"
#include "cdo_options.h"
void *
Arith(void *process)
{
......
......@@ -30,7 +30,6 @@
#include "cdo_int.h"
#include "param_conversion.h"
static void
fill_vars(int vlistID, std::vector<bool> &vars)
{
......
......@@ -31,7 +31,6 @@
#include "cdo_int.h"
#include "calendar.h"
static double
dayofyear(int calendar, int64_t vdate, int vtime)
{
......
......@@ -87,7 +87,7 @@ Cat(void *process)
vlistCompare(vlistID1, vlistID2, CMP_ALL);
tsID2 = vlistNtsteps(vlistID2);
if (tsID2 == 0) tsID2 = 1; // bug fix for time constant data only
if (tsID2 == 0) tsID2 = 1; // bug fix for time constant data only
if (ntsteps == 0) lconstvars = false;
}
......
......@@ -33,19 +33,18 @@
#include "cdo_int.h"
#include "param_conversion.h"
int stringToParam(const char *paramstr);
#define MAXARG 16384
static
void changeName(const int vlistID1, const int vlistID2, const int nch, char *chnames[MAXARG])
static void
changeName(const int vlistID1, const int vlistID2, const int nch, char *chnames[MAXARG])
{
char varname[CDI_MAX_NAME], varname2[CDI_MAX_NAME];
const int npairs = nch/2;
std::vector<std::pair<char*,char*>> vpairs(npairs);
for (int i = 0; i < npairs; ++i) vpairs[i].first = chnames[i*2];
for (int i = 0; i < npairs; ++i) vpairs[i].second = chnames[i*2+1];
const int npairs = nch / 2;
std::vector<std::pair<char *, char *>> vpairs(npairs);
for (int i = 0; i < npairs; ++i) vpairs[i].first = chnames[i * 2];
for (int i = 0; i < npairs; ++i) vpairs[i].second = chnames[i * 2 + 1];
const int nvars = vlistNvars(vlistID2);
std::vector<bool> namefound(npairs, false);
......@@ -55,7 +54,7 @@ void changeName(const int vlistID1, const int vlistID2, const int nch, char *chn
for (int i = 0; i < npairs; ++i)
if (strcmp(varname, vpairs[i].first) == 0)
{
namefound[i] = true;
namefound[i] = true;
vlistDefVarName(vlistID2, varID, vpairs[i].second);
break;
}
......@@ -68,7 +67,7 @@ void changeName(const int vlistID1, const int vlistID2, const int nch, char *chn
searchForGridName = true;
break;
}
if (searchForGridName)
{
const int ngrids = vlistNgrids(vlistID1);
......@@ -116,7 +115,7 @@ void changeName(const int vlistID1, const int vlistID2, const int nch, char *chn
searchForZaxisName = true;
break;
}
if (searchForZaxisName)
{
const int nzaxis = vlistNzaxis(vlistID1);
......@@ -145,7 +144,6 @@ void changeName(const int vlistID1, const int vlistID2, const int nch, char *chn
if (!namefound[i]) cdoWarning("Variable name %s not found!", vpairs[i].first);
}
void *
Change(void *process)
{
......
......@@ -318,7 +318,8 @@ Cloudlayer(void *process)
for (varID = 0; varID < nvars2; ++varID)
{
if (kmax[varID] != -1 && kmin[varID] != -1) layer_cloud(aclcac.data(), cloud[varID].data(), kmax[varID], kmin[varID], gridsize);
if (kmax[varID] != -1 && kmin[varID] != -1)
layer_cloud(aclcac.data(), cloud[varID].data(), kmax[varID], kmin[varID], gridsize);
}
for (varID = 0; varID < nvars2; ++varID)
......
......@@ -102,8 +102,8 @@ genGrid(int ngrids, int nfiles, std::vector<ensfileType> &ef, bool ginit, int ig
if (gridtype == GRID_UNSTRUCTURED) lunstructured = true;
const int nv = lunstructured ? gridInqNvertex(gridID) : 0;
const bool lcenter = globalGridType == CDI_UNDEFID && gridInqXvals(gridID, nullptr) > 0 && gridInqYvals(gridID, nullptr) > 0;
const bool lbounds
= lunstructured && globalGridType == CDI_UNDEFID && gridInqXbounds(gridID, nullptr) > 0 && gridInqYbounds(gridID, nullptr) > 0;
const bool lbounds = lunstructured && globalGridType == CDI_UNDEFID && gridInqXbounds(gridID, nullptr) > 0
&& gridInqYbounds(gridID, nullptr) > 0;
std::vector<long> xsize(nfiles);
std::vector<long> ysize(nfiles);
......@@ -230,15 +230,13 @@ genGrid(int ngrids, int nfiles, std::vector<ensfileType> &ef, bool ginit, int ig
for (long j = 0; j < ny; ++j) ysize2 += ysize[xyinfo[j * nx].id];
if (Options::cdoVerbose) cdoPrint("xsize2 %ld ysize2 %ld", xsize2, ysize2);
{ // verify size of data
{ // verify size of data
const long xs = xsize[xyinfo[0].id];
for (long j = 1; j < ny; ++j)
if (xsize[xyinfo[j * nx].id] != xs)
cdoAbort("xsize=%ld differ from first file (xsize=%ld)!", xsize[xyinfo[j * nx].id], xs);
if (xsize[xyinfo[j * nx].id] != xs) cdoAbort("xsize=%ld differ from first file (xsize=%ld)!", xsize[xyinfo[j * nx].id], xs);
const long ys = ysize[xyinfo[0].id];
for (long i = 1; i < nx; ++i)
if (ysize[xyinfo[i].id] != ys)
cdoAbort("ysize=%ld differ from first file (ysize=%ld)!", ysize[xyinfo[i].id], ys);
if (ysize[xyinfo[i].id] != ys) cdoAbort("ysize=%ld differ from first file (ysize=%ld)!", ysize[xyinfo[i].id], ys);
}
std::vector<double> xvals2, yvals2;
......
......@@ -209,7 +209,8 @@ com_vars(const char *arg)
return 0;
}
/* Look up NAME as the name of a command, and return a pointer to that command. Return a nullptr pointer if NAME isn't a command name.
/* Look up NAME as the name of a command, and return a pointer to that command. Return a nullptr pointer if NAME isn't a command
* name.
*/
command_t *
find_command(char *name)
......@@ -261,8 +262,9 @@ stripwhite(char *string)
return s;
}
extern "C" {
size_t getPeakRSS();
extern "C"
{
size_t getPeakRSS();
}
void
......
......@@ -31,7 +31,6 @@
#include "cdo_int.h"
#include "param_conversion.h"
void *
Compc(void *process)
{
......
......@@ -19,7 +19,6 @@
#include "cdo_int.h"
void *
Complextorect(void *process)
{
......
......@@ -26,7 +26,6 @@
#include "cdo_int.h"
void *
Cond(void *process)
{
......
......@@ -25,7 +25,6 @@
#include "cdo_int.h"
void *
Cond2(void *process)
{
......@@ -92,7 +91,8 @@ Cond2(void *process)
std::vector<double> array3(gridsize);
std::vector<double> array4(gridsize);
if (Options::cdoVerbose) cdoPrint("Number of timesteps: file1 %d, file2 %d, file3 %d", ntsteps1, ntsteps2, vlistNtsteps(vlistID3));
if (Options::cdoVerbose)
cdoPrint("Number of timesteps: file1 %d, file2 %d, file3 %d", ntsteps1, ntsteps2, vlistNtsteps(vlistID3));
if (filltype == FILL_NONE)
{
......
......@@ -27,7 +27,6 @@
#include "cdo_int.h"
#include "param_conversion.h"
void *
Condc(void *process)
{
......
......@@ -35,7 +35,6 @@
#include "cdo_int.h"
#include "param_conversion.h"
enum
{
CONSECSUM,
......
......@@ -28,8 +28,9 @@
#include "cdo_options.h"
extern "C" {
int streamGrbInqDataScanningMode(void);
extern "C"
{
int streamGrbInqDataScanningMode(void);
}
void *
......
......@@ -27,7 +27,6 @@
#include "datetime.h"
void *
Deltat(void *process)
{
......@@ -81,7 +80,7 @@ Deltat(void *process)
while ((nrecs = cdoStreamInqTimestep(streamID1, tsID)))
{
const JulianDate juldate1 = julianDateEncode(calendar, taxisInqVdate(taxisID1), taxisInqVtime(taxisID1));
const double idt_in_sec = ldivdt ? 1./julianDateToSeconds(julianDateSub(juldate1, juldate0)) : 1;
const double idt_in_sec = ldivdt ? 1. / julianDateToSeconds(julianDateSub(juldate1, juldate0)) : 1;
juldate0 = juldate1;
taxisCopyTimestep(taxisID2, taxisID1);
......
......@@ -167,7 +167,7 @@ Diff(void *process)
break;
}
}
if (it->second != varID2 && recID2next == nrecs2)
cdoAbort("Internal problem: varID2=%d not found in second stream!", it->second);
......
......@@ -290,8 +290,8 @@ Distgrid(void *process)
size_t xinc = nx / nxblocks;
size_t yinc = ny / nyblocks;
if (nx % xinc && nx % (xinc + 1) && nxblocks*(xinc + 1) <= nx) xinc++;
if (ny % yinc && ny % (yinc + 1) && nyblocks*(yinc + 1) <= ny) yinc++;
if (nx % xinc && nx % (xinc + 1) && nxblocks * (xinc + 1) <= nx) xinc++;
if (ny % yinc && ny % (yinc + 1) && nyblocks * (yinc + 1) <= ny) yinc++;
const size_t nsplit = nxblocks * nyblocks;
if (nsplit > MAX_BLOCKS) cdoAbort("Too many blocks (max = %d)!", MAX_BLOCKS);
......
......@@ -20,7 +20,6 @@
#include "cdo_int.h"
#include "param_conversion.h"
#define NALLOC_INC 1024
void *
......
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