Commit 7a182cac authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

clang-format.

parent cd3ffef9
......@@ -89,8 +89,8 @@ adipot(const double t, const double s, const double p)
}
static void
calc_adisit(size_t gridsize, size_t nlevel, const std::vector<double> &pressure, const FieldVector &tho,
const FieldVector &sao, FieldVector &tis)
calc_adisit(size_t gridsize, size_t nlevel, const std::vector<double> &pressure, const FieldVector &tho, const FieldVector &sao,
FieldVector &tis)
{
// pressure units: hPa
// tho units: Celsius
......@@ -119,8 +119,8 @@ calc_adisit(size_t gridsize, size_t nlevel, const std::vector<double> &pressure,
}
static void
calc_adipot(size_t gridsize, size_t nlevel, const std::vector<double> &pressure, const FieldVector &t,
const FieldVector &s, FieldVector &tpot)
calc_adipot(size_t gridsize, size_t nlevel, const std::vector<double> &pressure, const FieldVector &t, const FieldVector &s,
FieldVector &tpot)
{
// pressure units: hPa
// t units: Celsius
......
......@@ -1374,7 +1374,8 @@ after_precntl(struct Control *globs, struct Variable *vars)
}
}
if (globs->Truncation == 0 && globs->Latitudes == 0) afterAbort("Unsupported file structure (no spectral or Gaussian data found)!");
if (globs->Truncation == 0 && globs->Latitudes == 0)
afterAbort("Unsupported file structure (no spectral or Gaussian data found)!");
if (globs->Truncation == 0)
{
......
......@@ -74,13 +74,11 @@ print_stat(const char *sinfo, int memtype, int datatype, int filetype, off_t nva
nvalues /= 1000000;
data_size /= 1024. * 1024. * 1024.;
cdoPrint("%s Read %.1f GB of %d bit floats from %s %s, %.1f MVal/s",
sinfo, data_size, memtype == MEMTYPE_FLOAT ? 32 : 64, datatypestr(datatype),
filetypestr(filetype), tw > 0 ? nvalues / tw : -1);
cdoPrint("%s Read %.1f GB of %d bit floats from %s %s, %.1f MVal/s", sinfo, data_size, memtype == MEMTYPE_FLOAT ? 32 : 64,
datatypestr(datatype), filetypestr(filetype), tw > 0 ? nvalues / tw : -1);
file_size /= 1024. * 1024. * 1024.;
cdoPrint("%s Read %.1f GB in %.1f seconds, total %.1f MB/s", sinfo, file_size, tw,
tw > 0 ? 1024 * file_size / tw : -1);
cdoPrint("%s Read %.1f GB in %.1f seconds, total %.1f MB/s", sinfo, file_size, tw, tw > 0 ? 1024 * file_size / tw : -1);
}
void *
......
......@@ -37,8 +37,8 @@ print_stat(const char *sinfo, int memtype, int datatype, int filetype, off_t nva
data_size /= 1024. * 1024. * 1024.;
double rout = (tw > 0) ? nvalues / tw : -1;
cdoPrint("%s Wrote %.1f GB of %d bit floats to %s %s, %.1f MVal/s",
sinfo, data_size, memtype == MEMTYPE_FLOAT ? 32 : 64, datatypestr(datatype), filetypestr(filetype), rout);
cdoPrint("%s Wrote %.1f GB of %d bit floats to %s %s, %.1f MVal/s", sinfo, data_size, memtype == MEMTYPE_FLOAT ? 32 : 64,
datatypestr(datatype), filetypestr(filetype), rout);
file_size /= 1024. * 1024. * 1024.;
......
......@@ -218,8 +218,7 @@ Consecstat(void *process)
}
#ifdef _OPENMP
#pragma omp parallel for default(shared) schedule(static)
for (size_t i = 0; i < vars[varID][levelID].size; i++)
hist[varID][levelID].vec[i] = vars[varID][levelID].vec[i];
for (size_t i = 0; i < vars[varID][levelID].size; i++) hist[varID][levelID].vec[i] = vars[varID][levelID].vec[i];
#else
hist[varID][levelID].vec = vars[varID][levelID].vec;
#endif
......
......@@ -28,7 +28,6 @@
#include "datetime.h"
#include "cimdOmp.h"
#define NALLOC_INC 1024
static void
......@@ -86,7 +85,7 @@ Detrend(void *process)
int tsID = 0;
while ((nrecs = cdoStreamInqTimestep(streamID1, tsID)))
{
if ((size_t)tsID >= vars.size()) vars.resize(vars.size() + NALLOC_INC);
if ((size_t) tsID >= vars.size()) vars.resize(vars.size() + NALLOC_INC);
dtlist.taxisInqTimestep(taxisID1, tsID);
......
......@@ -74,9 +74,9 @@ Duplicate(void *process)
int tsID = 0;
while ((nrecs = cdoStreamInqTimestep(streamID1, tsID)))
{
if ((size_t)tsID >= vdate.size()) vdate.resize(vdate.size() + NALLOC_INC);
if ((size_t)tsID >= vtime.size()) vtime.resize(vtime.size() + NALLOC_INC);
if ((size_t)tsID >= vars.size()) vars.resize(vars.size() + NALLOC_INC);
if ((size_t) tsID >= vdate.size()) vdate.resize(vdate.size() + NALLOC_INC);
if ((size_t) tsID >= vtime.size()) vtime.resize(vtime.size() + NALLOC_INC);
if ((size_t) tsID >= vars.size()) vars.resize(vars.size() + NALLOC_INC);
vdate[tsID] = taxisInqVdate(taxisID1);
vtime[tsID] = taxisInqVtime(taxisID1);
......
......@@ -30,7 +30,6 @@
#include "util_files.h"
#include "cimdOmp.h"
// Defines for rank histogram
enum TDATA_TYPE
{
......@@ -231,12 +230,12 @@ Ensstat3(void *process)
for (int fileID = 0; fileID < nfiles; fileID++) ef[fileID].array = (double *) Malloc(gridsize * sizeof(double));
if (operfunc == func_rank && datafunc == SPACE)
{ // need to memorize data for entire grid before writing
{ // need to memorize data for entire grid before writing
array2 = (int **) Malloc((nfiles + 1) * sizeof(int *));
for (binID = 0; binID < nfiles; binID++) array2[binID] = (int *) Calloc(gridsize, sizeof(int));
}
else if (operfunc == func_rank)
{ // can process data separately for each timestep and only need to cumulate values over the grid
{ // can process data separately for each timestep and only need to cumulate values over the grid
array2 = (int **) Malloc((nfiles + 1) * sizeof(int *));
for (binID = 0; binID < nfiles; binID++) array2[binID] = (int *) Calloc(1, sizeof(int));
}
......
......@@ -144,7 +144,7 @@ Eofcoeff(void *process)
// ALLOCATE temporary fields for data read and write
Field in, out;
in.resize(gridsize );
in.resize(gridsize);
in.grid = gridID1;
out.missval = missval1;
out.nmiss = 0;
......
......@@ -199,7 +199,8 @@ Eofcoeff3d(void *process)
if (!DBL_IS_EQUAL(in.vec[i], missval2) && !DBL_IS_EQUAL(eof[varID][levelID][eofID].vec[i], missval1))
{
// out[varID][eofID].vec[0] += w[i]*in.vec[i]*eof[varID][levelID][eofID].vec[i];
out[varID][eofID].vec[0] += in.vec[i] * eof[varID][levelID][eofID].vec[i];;
out[varID][eofID].vec[0] += in.vec[i] * eof[varID][levelID][eofID].vec[i];
;
}
else
nmiss += 1;
......
......@@ -42,11 +42,9 @@
#include "expr.h"
#include "datetime.h"
void grid_cell_area(int gridID, double *array);
int getSurfaceID(int vlistID);
static char *
exprsFromArgument(int exprArgc, const char **exprArgv)
{
......@@ -482,7 +480,7 @@ Expr(void *process)
}
}
}
cdoVlistCopyFlag(vlistID2, vlistID1); // Copy global attributes
cdoVlistCopyFlag(vlistID2, vlistID1); // Copy global attributes
// printf("parse_arg.nparams %d\n", parse_arg.nparams);
for (int pidx = 0; pidx < parse_arg.nparams; pidx++)
......
......@@ -469,7 +469,7 @@ setmisstodis(Field &field1, Field &field2, int numNeighbors)
#ifdef _OPENMP
#pragma omp parallel for default(none) \
shared(nmiss, knnWeights, findex, mindex, vindex, array1, array2, xvals, yvals, gps, numNeighbors)
shared(nmiss, knnWeights, findex, mindex, vindex, array1, array2, xvals, yvals, gps, numNeighbors)
#endif
for (size_t i = 0; i < nmiss; ++i)
{
......@@ -507,7 +507,7 @@ void *
Fillmiss(void *process)
{
int nrecs, varID, levelID;
void (*fill_method)(Field &fin, Field &fout, int) = &setmisstodis;
void (*fill_method)(Field & fin, Field & fout, int) = &setmisstodis;
cdoInitialize(process);
......
......@@ -182,7 +182,7 @@ Filter(void *process)
int tsID = 0;
while ((nrecs = cdoStreamInqTimestep(streamID1, tsID)))
{
if ((size_t)tsID >= vars.size()) vars.resize(vars.size() + NALLOC_INC);
if ((size_t) tsID >= vars.size()) vars.resize(vars.size() + NALLOC_INC);
dtlist.taxisInqTimestep(taxisID1, tsID);
......
......@@ -40,8 +40,8 @@
#include "pmlist.h"
static void
print_location_LL(int operfunc, int vlistID, int varID, int levelID, int gridID, double sglval,
const std::vector<double> &fieldvec, int64_t vdate, int vtime)
print_location_LL(int operfunc, int vlistID, int varID, int levelID, int gridID, double sglval, const std::vector<double> &fieldvec,
int64_t vdate, int vtime)
{
static bool showHeader = true;
const int code = vlistInqVarCode(vlistID, varID);
......
......@@ -36,8 +36,7 @@ orthodrome(double px1, double py1, double px2, double py2)
return acos(sin(py1) * sin(py2) + cos(py1) * cos(py2) * cos(px2 - px1));
}
double
gridGetPlanetRadius(int gridID);
double gridGetPlanetRadius(int gridID);
double
getPlanetRadius(int gridID)
......@@ -61,7 +60,7 @@ getPlanetRadius(int gridID)
return planetRadius;
}
void
grid_cell_area(int gridID, double *array)
{
......@@ -116,7 +115,7 @@ Gridcell(void *process)
const int operatorID = cdoOperatorID();
//const bool needRadius = cdoOperatorF1(operatorID) > 0;
// const bool needRadius = cdoOperatorF1(operatorID) > 0;
CdoStreamID streamID1 = cdoOpenRead(0);
const int vlistID1 = cdoStreamInqVlist(streamID1);
......
......@@ -261,8 +261,7 @@ Gridsearch(void *process)
int gridID1 = cdoDefineGrid(operatorArgv()[0]);
int gridID2 = cdoDefineGrid(operatorArgv()[1]);
if (operatorID == CSEARCH)
cell_search(gridID1, gridID2);
if (operatorID == CSEARCH) cell_search(gridID1, gridID2);
cdoFinish();
......
......@@ -270,7 +270,6 @@ Harmonic(void *process)
cdoStreamClose(streamID2);
}
for (int j = 0; j < n_out; ++j)
{
for (varID = 0; varID < nvars; ++varID) Free(out[j][varID]);
......
......@@ -167,7 +167,7 @@ Importobs(void *process)
vdate0 = vdate;
vtime0 = vtime;
//printf("%s %d %d %g %g %g %d %g %g %g\n", station, vdate, vtime, lat, lon, height1, code, pressure, height2, value);
// printf("%s %d %d %g %g %g %d %g %g %g\n", station, vdate, vtime, lat, lon, height1, code, pressure, height2, value);
taxisDefVdate(taxisID, vdate);
taxisDefVtime(taxisID, vtime);
cdoDefTimestep(streamID, tsID);
......
......@@ -339,8 +339,8 @@ Info(void *process)
if ((tsID == 0 && recID == 0) || operatorID == MAP)
{
set_text_color(stdout, BRIGHT);
MpMO::Print("%6d : Date Time %s Gridsize Miss : Minimum Mean Maximum : %s%s", -(indf + 1),
lvinfo ? "Nlevs" : "Level", e, v);
MpMO::Print("%6d : Date Time %s Gridsize Miss : Minimum Mean Maximum : %s%s",
-(indf + 1), lvinfo ? "Nlevs" : "Level", e, v);
reset_text_color(stdout);
}
......
......@@ -500,11 +500,11 @@ Intlevel(void *process)
const size_t gridsize = varList1[varID].gridsize;
if (zvarname)
vert_interp_lev3d(gridsize, missval, &vardata1[varID][0], &vardata2[varID][0], nlev2, lev_idx1.data(), lev_idx2.data(),
lev_wgt1.data(), lev_wgt2.data());
vert_interp_lev3d(gridsize, missval, &vardata1[varID][0], &vardata2[varID][0], nlev2, lev_idx1.data(),
lev_idx2.data(), lev_wgt1.data(), lev_wgt2.data());
else
vert_interp_lev(gridsize, missval, &vardata1[varID][0], &vardata2[varID][0], nlev2, lev_idx1.data(), lev_idx2.data(),
lev_wgt1.data(), lev_wgt2.data());
vert_interp_lev(gridsize, missval, &vardata1[varID][0], &vardata2[varID][0], nlev2, lev_idx1.data(),
lev_idx2.data(), lev_wgt1.data(), lev_wgt2.data());
for (levelID = 0; levelID < nlev2; levelID++)
{
......
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