Commit 54135e4b authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

clang-format: reformat.

parent 686c4dc4
......@@ -36,7 +36,7 @@ BreakBeforeBinaryOperators: All
BreakBeforeBraces: GNU
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
ColumnLimit: 128
ColumnLimit: 132
CommentPragmas: '^ IWYU pragma:'
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
......
......@@ -179,8 +179,7 @@ after_PostProcess(struct Control *globs)
if (lstdout)
{
if (globs->OutputInterval == DAILY_INTERVAL)
fprintf(stdout, " Processed Day %2d Month %2d Year %04d", globs->OldDate.dy, globs->OldDate.mo,
globs->OldDate.yr);
fprintf(stdout, " Processed Day %2d Month %2d Year %04d", globs->OldDate.dy, globs->OldDate.mo, globs->OldDate.yr);
else if (globs->OutputInterval == MONTHLY_INTERVAL)
fprintf(stdout, " Processed Month %2d Year %04d", globs->OldDate.mo, globs->OldDate.yr);
else if (globs->OutputInterval == UNLIM_INTERVAL)
......@@ -493,8 +492,8 @@ after_readTimestep(void *arg)
fprintf(stderr, "T%d", globs->Truncation);
fprintf(stderr, " Code %3d Level%6d %6.4d-%2.2d-%2.2d %2.2d:%2.2d:00\n", code,
(int) zaxisInqLevel(zaxisID, levelID), globs->OldDate.yr, globs->OldDate.mo, globs->OldDate.dy,
globs->OldDate.hr, globs->OldDate.mn);
(int) zaxisInqLevel(zaxisID, levelID), globs->OldDate.yr, globs->OldDate.mo, globs->OldDate.dy, globs->OldDate.hr,
globs->OldDate.mn);
}
if (analysisData)
......@@ -1493,8 +1492,7 @@ after_precntl(struct Control *globs, struct Variable *vars)
}
}
if (globs->Truncation == 0 && globs->Latitudes == 0)
Error("Unsupported file structure (no spectral or Gaussian data found)!");
if (globs->Truncation == 0 && globs->Latitudes == 0) Error("Unsupported file structure (no spectral or Gaussian data found)!");
if (globs->Truncation == 0)
{
......@@ -1537,10 +1535,7 @@ after_precntl(struct Control *globs, struct Variable *vars)
{
if (nvct == 0)
{
if (numlevel != 191)
Warning("VCT missing for hybrid level data with %d "
"levels!",
numlevel);
if (numlevel != 191) Warning("VCT missing for hybrid level data with %d levels!", numlevel);
}
else
{
......@@ -1671,8 +1666,7 @@ after_precntl(struct Control *globs, struct Variable *vars)
if (globs->Debug)
for (code = 0; code < MaxCodes; code++)
{
if (vars[code].detected)
fprintf(stderr, " Detected Code %3d with %3d level\n", code, zaxisInqSize(vars[code].izaxisID));
if (vars[code].detected) fprintf(stderr, " Detected Code %3d with %3d level\n", code, zaxisInqSize(vars[code].izaxisID));
}
}
......@@ -1996,9 +1990,8 @@ after_procstat(char *procpath, int truncation)
if ((hostname = getenv("HOST")) == NULL) hostname = unknown;
setvbuf(sf, (char *) NULL, _IONBF, 0);
fprintf(sf, "%.7s %4.4ld.%2.2ld.%2.2ld %2.2ld:%2.2ld %s "
"%-9.9s %7.1f %7.1f T%3.3d %s\n",
name, yy, mm, dd, hh, mi, VERSION, proc, MaxMBytes, CPUTime, truncation, hostname);
fprintf(sf, "%.7s %4.4ld.%2.2ld.%2.2ld %2.2ld:%2.2ld %s %-9.9s %7.1f %7.1f T%3.3d %s\n", name, yy, mm, dd, hh, mi, VERSION,
proc, MaxMBytes, CPUTime, truncation, hostname);
fclose(sf);
}
......
......@@ -68,8 +68,7 @@ datatypestr(int datatype)
}
static void
print_stat(const char *sinfo, int memtype, int datatype, int filetype, off_t nvalues, double data_size, double file_size,
double tw)
print_stat(const char *sinfo, int memtype, int datatype, int filetype, off_t nvalues, double data_size, double file_size, double tw)
{
nvalues /= 1000000;
data_size /= 1024. * 1024. * 1024.;
......
......@@ -26,8 +26,7 @@ const char *filetypestr(int filetype);
const char *datatypestr(int datatype);
static void
print_stat(const char *sinfo, int memtype, int datatype, int filetype, off_t nvalues, double data_size, double file_size,
double tw)
print_stat(const char *sinfo, int memtype, int datatype, int filetype, off_t nvalues, double data_size, double file_size, double tw)
{
nvalues /= 1000000;
data_size /= 1024. * 1024. * 1024.;
......@@ -120,8 +119,7 @@ CDIwrite(void *process)
int gridID2 = gridID;
if (gridInqType(gridID) == GRID_GME) gridID2 = gridToUnstructured(gridID, 0);
if (gridInqType(gridID) != GRID_UNSTRUCTURED && gridInqType(gridID) != GRID_CURVILINEAR)
gridID2 = gridToCurvilinear(gridID, 0);
if (gridInqType(gridID) != GRID_UNSTRUCTURED && gridInqType(gridID) != GRID_CURVILINEAR) gridID2 = gridToCurvilinear(gridID, 0);
gridInqXvals(gridID2, &xvals[0]);
gridInqYvals(gridID2, &yvals[0]);
......
This diff is collapsed.
......@@ -140,40 +140,34 @@ cmor_check_eval(int vlistID, int nvars, var_t *vars)
vlistInqVarName(vlistID, varID, varname);
if (n_lower_min > 0)
cdoWarning("Invalid value(s) detected for variable '%s': %ld "
"values were lower than minimum valid value (%.4g).",
cdoWarning("Invalid value(s) detected for variable '%s': %ld values were lower than minimum valid value (%.4g).",
varname, n_lower_min, var->valid_min);
if (n_greater_max > 0)
cdoWarning("Invalid value(s) detected for variable '%s': %ld "
"values were greater than maximum valid value (%.4g).",
cdoWarning("Invalid value(s) detected for variable '%s': %ld values were greater than maximum valid value (%.4g).",
varname, n_greater_max, var->valid_max);
if (var->check_min_mean_abs)
{
if (amean < .1 * var->ok_min_mean_abs)
cdoWarning("Invalid Absolute Mean for variable '%s' (%.5g) is "
"lower by more than an order of magnitude than "
cdoWarning("Invalid Absolute Mean for variable '%s' (%.5g) is lower by more than an order of magnitude than "
"minimum allowed: %.4g",
varname, amean, var->ok_min_mean_abs);
if (amean < var->ok_min_mean_abs)
cdoWarning("Invalid Absolute Mean for variable '%s' (%.5g) is "
"lower than minimum allowed: %.4g",
varname, amean, var->ok_min_mean_abs);
cdoWarning("Invalid Absolute Mean for variable '%s' (%.5g) is lower than minimum allowed: %.4g", varname, amean,
var->ok_min_mean_abs);
}
if (var->check_max_mean_abs)
{
if (amean > 10. * var->ok_max_mean_abs)
cdoWarning("Invalid Absolute Mean for variable '%s' (%.5g) is "
"greater by more than an order of magnitude than "
cdoWarning("Invalid Absolute Mean for variable '%s' (%.5g) is greater by more than an order of magnitude than "
"maximum allowed: %.4g",
varname, amean, var->ok_max_mean_abs);
if (amean > var->ok_max_mean_abs)
cdoWarning("Invalid Absolute Mean for variable '%s' (%.5g) is "
"greater than maximum allowed: %.4g",
varname, amean, var->ok_max_mean_abs);
cdoWarning("Invalid Absolute Mean for variable '%s' (%.5g) is greater than maximum allowed: %.4g", varname, amean,
var->ok_max_mean_abs);
}
}
}
......@@ -555,9 +549,8 @@ CMOR_lite(void *process)
}
if (nerr)
{
cdoWarning("Udunits: Error converting units from [%s] to "
"[%s], parameter: %s",
var->units_old, var->units, var->name);
cdoWarning("Udunits: Error converting units from [%s] to [%s], parameter: %s", var->units_old, var->units,
var->name);
var->changeunits = false;
}
}
......
......@@ -181,8 +181,7 @@ Cloudlayer(void *process)
if (aclcacID == -1)
{
if (aclcac_code_found)
cdoAbort("Cloud cover (parameter 223) not found on pressure or hybrid "
"levels!");
cdoAbort("Cloud cover (parameter 223) not found on pressure or hybrid levels!");
else
cdoAbort("Cloud cover (parameter 223) not found!");
}
......
......@@ -158,8 +158,7 @@ genGrid(int ngrids, int nfiles, std::vector<ensfileType> &ef, bool ginit, int ig
}
if (cdoVerbose && lregular)
for (int fileID = 0; fileID < nfiles; fileID++)
printf("1 %d %g %g \n", xyinfo[fileID].id, xyinfo[fileID].x, xyinfo[fileID].y);
for (int fileID = 0; fileID < nfiles; fileID++) printf("1 %d %g %g \n", xyinfo[fileID].id, xyinfo[fileID].x, xyinfo[fileID].y);
if (lregular)
{
......
......@@ -203,8 +203,8 @@ com_vars(const char *arg)
{
cdiParamToString(all_vars[varID].param, paramstr, sizeof(paramstr));
fprintf(stdout, "varID=%3d, param=%s, name=%s, longname=\"%s\", units=\"%s\"\n", varID + 1, paramstr,
all_vars[varID].name, all_vars[varID].longname, all_vars[varID].units);
fprintf(stdout, "varID=%3d, param=%s, name=%s, longname=\"%s\", units=\"%s\"\n", varID + 1, paramstr, all_vars[varID].name,
all_vars[varID].longname, all_vars[varID].units);
}
return 0;
......
......@@ -254,33 +254,33 @@ Comp(void *process)
else if (operatorID == NE)
{
for (size_t i = 0; i < gridsize; i++)
array3[i] = (DBL_IS_EQUAL(array1[i], missval1) || DBL_IS_EQUAL(array2[i], missval2)
? missval1
: IS_NOT_EQUAL(array1[i], array2[i]));
array3[i]
= (DBL_IS_EQUAL(array1[i], missval1) || DBL_IS_EQUAL(array2[i], missval2) ? missval1
: IS_NOT_EQUAL(array1[i], array2[i]));
}
else if (operatorID == LE)
{
for (size_t i = 0; i < gridsize; i++)
array3[i] = (DBL_IS_EQUAL(array1[i], missval1) || DBL_IS_EQUAL(array2[i], missval2) ? missval1
: array1[i] <= array2[i]);
array3[i]
= (DBL_IS_EQUAL(array1[i], missval1) || DBL_IS_EQUAL(array2[i], missval2) ? missval1 : array1[i] <= array2[i]);
}
else if (operatorID == LT)
{
for (size_t i = 0; i < gridsize; i++)
array3[i] = (DBL_IS_EQUAL(array1[i], missval1) || DBL_IS_EQUAL(array2[i], missval2) ? missval1
: array1[i] < array2[i]);
array3[i]
= (DBL_IS_EQUAL(array1[i], missval1) || DBL_IS_EQUAL(array2[i], missval2) ? missval1 : array1[i] < array2[i]);
}
else if (operatorID == GE)
{
for (size_t i = 0; i < gridsize; i++)
array3[i] = (DBL_IS_EQUAL(array1[i], missval1) || DBL_IS_EQUAL(array2[i], missval2) ? missval1
: array1[i] >= array2[i]);
array3[i]
= (DBL_IS_EQUAL(array1[i], missval1) || DBL_IS_EQUAL(array2[i], missval2) ? missval1 : array1[i] >= array2[i]);
}
else if (operatorID == GT)
{
for (size_t i = 0; i < gridsize; i++)
array3[i] = (DBL_IS_EQUAL(array1[i], missval1) || DBL_IS_EQUAL(array2[i], missval2) ? missval1
: array1[i] > array2[i]);
array3[i]
= (DBL_IS_EQUAL(array1[i], missval1) || DBL_IS_EQUAL(array2[i], missval2) ? missval1 : array1[i] > array2[i]);
}
else
{
......
......@@ -221,8 +221,7 @@ Consecstat(void *process)
for (size_t i = 0; i < gridInqSize(vars[varID][levelID].grid); i++)
hist[varID][levelID].ptr[i] = vars[varID][levelID].ptr[i];
#else
memcpy(hist[varID][levelID].ptr, vars[varID][levelID].ptr,
gridInqSize(vars[varID][levelID].grid) * sizeof(double));
memcpy(hist[varID][levelID].ptr, vars[varID][levelID].ptr, gridInqSize(vars[varID][levelID].grid) * sizeof(double));
#endif
break;
default: printf(SWITCHWARN, __func__); break;
......
......@@ -217,8 +217,7 @@ Derivepar(void *process)
if (operatorID == GHEIGHT)
{
if (humID == -1)
cdoWarning("%s not found - using algorithm without %s!", var_stdname(specific_humidity),
var_stdname(specific_humidity));
cdoWarning("%s not found - using algorithm without %s!", var_stdname(specific_humidity), var_stdname(specific_humidity));
else
hum.resize(gridsize * nhlevf);
......
......@@ -232,9 +232,7 @@ Distgrid(void *process)
}
if (index == ngrids)
cdoAbort("No Lon/Lat, Gaussian, curvilinear or generic grid found (%s data "
"unsupported)!",
gridNamePtr(gridtype));
cdoAbort("No Lon/Lat, Gaussian, curvilinear or generic grid found (%s data unsupported)!", gridNamePtr(gridtype));
gridID1 = vlistGrid(vlistID1, 0);
size_t gridsize = gridInqSize(gridID1);
......
......@@ -51,8 +51,8 @@ scale_eigvec_grid(double *restrict out, int tsID, size_t npack, const size_t *re
}
static void
scale_eigvec_time(double *restrict out, int tsID, int nts, size_t npack, const size_t *restrict pack,
const double *restrict weight, double **covar, double **data, double missval, double sum_w)
scale_eigvec_time(double *restrict out, int tsID, int nts, size_t npack, const size_t *restrict pack, const double *restrict weight,
double **covar, double **data, double missval, double sum_w)
{
#ifdef _OPENMP
#pragma omp parallel for default(none) shared(npack, nts, tsID, pack, data, covar, out)
......@@ -158,8 +158,7 @@ get_weightmode(void)
}
if (cdoVerbose)
cdoPrint("Using CDO_WEIGHT_MODE '%s' from %s", weight_mode == WEIGHT_OFF ? "off" : "on",
envstr ? "Environment" : " default");
cdoPrint("Using CDO_WEIGHT_MODE '%s' from %s", weight_mode == WEIGHT_OFF ? "off" : "on", envstr ? "Environment" : " default");
return weight_mode;
}
......@@ -544,7 +543,7 @@ EOFs(void *process)
j = pack[jpack];
covar[ipack][jpack] = covar[ipack][jpack] * // covariance
sqrt(weight[i]) * sqrt(weight[j]) / sum_w / // weights
nts; // number of data contributing
nts; // number of data contributing
}
}
}
......
......@@ -984,8 +984,7 @@ import_e5res(const char *filename, VAR **vars, ATTS *atts)
read_fc4d(nc_file_id, name, &(*vars)[varid], gridIDfc, zaxisIDml, nhgl, nmp1);
varid++;
}
else if (dimidsp[0] == nhgl_dimid && dimidsp[1] == nmp1_dimid && dimidsp[2] == complex_dimid
&& dimidsp[3] == ilev_dimid)
else if (dimidsp[0] == nhgl_dimid && dimidsp[1] == nmp1_dimid && dimidsp[2] == complex_dimid && dimidsp[3] == ilev_dimid)
{
read_fc4d(nc_file_id, name, &(*vars)[varid], gridIDfc, zaxisIDmlh, nhgl, nmp1);
varid++;
......
......@@ -26,7 +26,6 @@
#include "pstream_int.h"
#include "grid.h"
void
genGridIndex(int gridID1, int gridID2, int *index)
{
......
......@@ -469,8 +469,8 @@ Expr(void *process)
{
size_t ngp = params[varID].ngp;
size_t nlev = params[varID].nlev;
size_t nItems = MAX(4, ngp*nlev);
params[varID].data = (double*) Malloc(nItems*sizeof(double));
size_t nItems = MAX(4, ngp * nlev);
params[varID].data = (double *) Malloc(nItems * sizeof(double));
}
}
......@@ -478,8 +478,8 @@ Expr(void *process)
{
size_t ngp = params[varID].ngp;
size_t nlev = params[varID].nlev;
size_t nItems = MAX(4, ngp*nlev);
params[varID].data = (double*) Malloc(nItems*sizeof(double));
size_t nItems = MAX(4, ngp * nlev);
params[varID].data = (double *) Malloc(nItems * sizeof(double));
}
for (int i = 0; i < parse_arg.ncoords; i++)
......@@ -517,9 +517,7 @@ Expr(void *process)
if (ngp > 1)
{
int wstatus = gridWeights(gridID, data);
if (wstatus)
cdoWarning("Grid cell bounds not available, using "
"constant grid cell area weights!");
if (wstatus) cdoWarning("Grid cell bounds not available, using constant grid cell area weights!");
}
}
}
......
......@@ -316,10 +316,7 @@ Filedes(void *process)
int opt = (operatorID == GRIDDES) ? 1 : 0;
for (int index = 0; index < ngrids; index++)
{
printf("#\n"
"# gridID %d\n"
"#\n",
index + 1);
printf("#\n# gridID %d\n#\n", index + 1);
cdo_print_grid(vlistGrid(vlistID, index), opt);
}
}
......@@ -327,10 +324,7 @@ Filedes(void *process)
{
for (int index = 0; index < nzaxis; index++)
{
printf("#\n"
"# zaxisID %d\n"
"#\n",
index + 1);
printf("#\n# zaxisID %d\n#\n", index + 1);
cdo_print_zaxis(vlistZaxis(vlistID, index));
}
}
......@@ -349,8 +343,7 @@ Filedes(void *process)
{
if (operatorID == VCT)
{
fprintf(stdout, "# k vct_a(k) [Pa] "
"vct_b(k) []\n");
fprintf(stdout, "# k vct_a(k) [Pa] vct_b(k) []\n");
for (int i = 0; i < vctsize / 2; i++)
fprintf(stdout, "%5d %25.17f %25.17f\n", i, vct[i], vct[vctsize / 2 + i]);
}
......
......@@ -391,8 +391,7 @@ setmisstodis(Field *field1, Field *field2, int numNeighbors)
if (gridInqType(gridID) == GRID_GME) gridID = gridToUnstructured(gridID, 0);
if (gridInqType(gridID) != GRID_UNSTRUCTURED && gridInqType(gridID) != GRID_CURVILINEAR)
gridID = gridToCurvilinear(gridID, 0);
if (gridInqType(gridID) != GRID_UNSTRUCTURED && gridInqType(gridID) != GRID_CURVILINEAR) gridID = gridToCurvilinear(gridID, 0);
std::vector<double> xvals(gridsize);
std::vector<double> yvals(gridsize);
......@@ -459,8 +458,8 @@ setmisstodis(Field *field1, Field *field2, int numNeighbors)
double findex = 0;
#ifdef _OPENMP
#pragma omp parallel for default(none) shared(knnWeights, findex, mindex, vindex, array1, array2, xvals, \
yvals, gs, nmiss, numNeighbors)
#pragma omp parallel for default(none) shared(knnWeights, findex, mindex, vindex, array1, array2, xvals, yvals, gs, nmiss, \
numNeighbors)
#endif
for (size_t i = 0; i < nmiss; ++i)
{
......
......@@ -327,8 +327,7 @@ Filter(void *process)
filter_fftw(nts, fmasc, ompmem[ompthID].out_fft, &ompmem[ompthID].p_T2S, &ompmem[ompthID].p_S2T);
for (int tsID = 0; tsID < nts; tsID++)
vars[tsID][varID][levelID].ptr[i] = ompmem[ompthID].in_fft[tsID][0] / nts;
for (int tsID = 0; tsID < nts; tsID++) vars[tsID][varID][levelID].ptr[i] = ompmem[ompthID].in_fft[tsID][0] / nts;
}
#endif
}
......
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