Commit 4c976bec authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Renamed namespace Progress to progress.

parent 4162c643
......@@ -56,7 +56,7 @@ Cat(void *process)
const auto streamCnt = cdoStreamCnt();
const auto nfiles = streamCnt - 1;
Progress::init();
progress::init();
for (int indf = 0; indf < nfiles; ++indf)
{
......@@ -131,7 +131,7 @@ Cat(void *process)
while ((nrecs = cdoStreamInqTimestep(streamID1, tsID1)))
{
const double fstatus = (ntsteps > 1) ? indf + (tsID1 + 1.) / ntsteps : indf + 1.;
if (!Options::cdoVerbose) Progress::update(0, 1, fstatus / nfiles);
if (!Options::cdoVerbose) progress::update(0, 1, fstatus / nfiles);
taxisCopyTimestep(taxisID2, taxisID1);
cdoDefTimestep(streamID2, tsID2);
......
......@@ -77,7 +77,7 @@ Copy(void *process)
const auto streamCnt = cdoStreamCnt();
const auto nfiles = streamCnt - 1;
Progress::init();
progress::init();
int tsID2 = 0;
for (int indf = 0; indf < nfiles; ++indf)
......@@ -141,7 +141,7 @@ Copy(void *process)
while ((nrecs = cdoStreamInqTimestep(streamID1, tsID1)))
{
const double fstatus = (ntsteps > 1) ? indf + (tsID1 + 1.) / ntsteps : indf + 1.;
if (!Options::cdoVerbose) Progress::update(0, 1, fstatus / nfiles);
if (!Options::cdoVerbose) progress::update(0, 1, fstatus / nfiles);
taxisCopyTimestep(taxisID2, taxisID1);
cdoDefTimestep(streamID2, tsID2);
......
......@@ -464,7 +464,7 @@ setmisstodis(Field &field1, Field &field2, int numNeighbors)
if (Options::cdoVerbose) cdoPrint("Point search created: %.2f seconds", cdo_get_wtime() - start);
Progress::init();
progress::init();
start = Options::cdoVerbose ? cdo_get_wtime() : 0;
......@@ -480,7 +480,7 @@ setmisstodis(Field &field1, Field &field2, int numNeighbors)
#pragma omp atomic
#endif
findex++;
if (cdo_omp_get_thread_num() == 0) Progress::update(0, 1, findex / nmiss);
if (cdo_omp_get_thread_num() == 0) progress::update(0, 1, findex / nmiss);
const auto ompthID = cdo_omp_get_thread_num();
......@@ -497,7 +497,7 @@ setmisstodis(Field &field1, Field &field2, int numNeighbors)
}
}
Progress::update(0, 1, 1);
progress::update(0, 1, 1);
if (Options::cdoVerbose) cdoPrint("Point search nearest: %.2f seconds", cdo_get_wtime() - start);
......
......@@ -212,7 +212,7 @@ Select(void *process)
DateTimeList dtlist;
if (!Options::cdoVerbose && nfiles > 1) Progress::init();
if (!Options::cdoVerbose && nfiles > 1) progress::init();
int tsmax = -1;
......@@ -220,7 +220,7 @@ Select(void *process)
int tsID2 = 0;
for (int indf = 0; indf < nfiles; ++indf)
{
if (!Options::cdoVerbose && nfiles > 1) Progress::update(0, 1, (indf + 1.) / nfiles);
if (!Options::cdoVerbose && nfiles > 1) progress::update(0, 1, (indf + 1.) / nfiles);
if (Options::cdoVerbose) cdoPrint("Process file: %s", cdoGetStreamName(indf));
const auto streamID1 = cdoOpenRead(indf);
......@@ -707,7 +707,7 @@ Select(void *process)
END_LABEL:
if (!Options::cdoVerbose && nfiles > 1) Progress::update(0, 1, 1);
if (!Options::cdoVerbose && nfiles > 1) progress::update(0, 1, 1);
SELLIST_CHECK_FLAG(timestep_of_year);
SELLIST_CHECK_FLAG(timestep);
......
......@@ -109,7 +109,7 @@ smooth(int gridID, double missval, const double *restrict array1, double *restri
if (Options::cdoVerbose) cdoPrint("Point search created: %.2f seconds", cdo_get_wtime() - start);
if (Options::cdoVerbose) Progress::init();
if (Options::cdoVerbose) progress::init();
start = Options::cdoVerbose ? cdo_get_wtime() : 0;
......@@ -129,7 +129,7 @@ smooth(int gridID, double missval, const double *restrict array1, double *restri
#pragma omp atomic
#endif
findex++;
if (Options::cdoVerbose && cdo_omp_get_thread_num() == 0) Progress::update(0, 1, findex / gridsize);
if (Options::cdoVerbose && cdo_omp_get_thread_num() == 0) progress::update(0, 1, findex / gridsize);
gridSearchPointSmooth(gps, xvals[i], yvals[i], knnWeights[ompthID]);
......@@ -150,7 +150,7 @@ smooth(int gridID, double missval, const double *restrict array1, double *restri
*nmiss = nmissx;
Progress::update(0, 1, 1);
progress::update(0, 1, 1);
if (Options::cdoVerbose) cdoPrint("Point search nearest: %.2f seconds", cdo_get_wtime() - start);
if (Options::cdoVerbose) cdoPrint("Min/Max points found: %zu/%zu", naddsMin, naddsMax);
......
......@@ -359,7 +359,7 @@ cdo_init_is_tty()
if (S_ISCHR(statbuf.st_mode))
{
stdout_is_tty = true;
Progress::stdout_is_tty = true;
progress::stdout_is_tty = true;
}
fstat(2, &statbuf);
if (S_ISCHR(statbuf.st_mode)) stderr_is_tty = true;
......@@ -1339,7 +1339,7 @@ parseOptionsLong(int argc, char *argv[])
case 's':
Options::silentMode = true;
MpMO::enableSilentMode(Options::silentMode);
Progress::silentMode = true;
progress::silentMode = true;
break;
case 'T': Options::Timer = true; break;
case 't': CdoDefault::TableID = defineTable(CDO_optarg); break;
......@@ -1797,7 +1797,7 @@ main(int argc, char *argv[])
CdoOut::setExitFunction(cdoExit);
CdoOut::setContextFunction(processInqPrompt);
Progress::setContextFunction(processInqPrompt);
progress::setContextFunction(processInqPrompt);
mpmoColorSet(Auto);
......
......@@ -362,7 +362,7 @@ gridGenAreaReg2D(const int gridID, double *area, bool lweights)
int nv = 4;
double findex = 0;
Progress::init();
progress::init();
#ifdef _OPENMP
#pragma omp parallel for default(none) shared(gridsize, nlon, findex, area, nv, grid_corner_lon, grid_corner_lat)
......@@ -373,14 +373,14 @@ gridGenAreaReg2D(const int gridID, double *area, bool lweights)
#pragma omp atomic
#endif
findex++;
if (cdo_omp_get_thread_num() == 0) Progress::update(0, 1, findex / gridsize);
if (cdo_omp_get_thread_num() == 0) progress::update(0, 1, findex / gridsize);
double lons[4], lats[4];
getLonLatCorner(nlon, i, grid_corner_lon.data(), grid_corner_lat.data(), lons, lats);
area[i] = mod_huiliers_area(nv, lons, lats);
}
Progress::update(0, 1, 1);
progress::update(0, 1, 1);
return status;
}
......@@ -485,7 +485,7 @@ gridGenAreaUnstruct(int gridID, double *area)
double findex = 0;
Progress::init();
progress::init();
#ifdef _OPENMP
#pragma omp parallel for default(none) \
......@@ -497,7 +497,7 @@ gridGenAreaUnstruct(int gridID, double *area)
#pragma omp atomic
#endif
findex++;
if (cdo_omp_get_thread_num() == 0) Progress::update(0, 1, findex / gridsize);
if (cdo_omp_get_thread_num() == 0) progress::update(0, 1, findex / gridsize);
if (nv <= 4)
area[i] = mod_huiliers_area(nv, &grid_corner_lon[i * nv], &grid_corner_lat[i * nv]);
......@@ -506,7 +506,7 @@ gridGenAreaUnstruct(int gridID, double *area)
= mod_huiliers_area2(nv, &grid_corner_lon[i * nv], &grid_corner_lat[i * nv], grid_center_lon[i], grid_center_lat[i]);
}
Progress::update(0, 1, 1);
progress::update(0, 1, 1);
return status;
}
......
......@@ -233,7 +233,7 @@ intlinarr2(double missval, int lon_is_circular, size_t nxm, size_t nym, const do
for (size_t jj = 0; jj < nym; ++jj)
for (size_t ii = 0; ii < nlon1; ++ii) grid1_mask[jj * nlon1 + ii] = !DBL_IS_EQUAL(fieldm[jj * nlon1 + ii], missval);
Progress::init();
progress::init();
#ifdef _OPENMP
#pragma omp parallel for default(none) \
......@@ -249,7 +249,7 @@ intlinarr2(double missval, int lon_is_circular, size_t nxm, size_t nym, const do
#pragma omp atomic
#endif
findex++;
if (cdo_omp_get_thread_num() == 0) Progress::update(0, 1, findex / gridsize2);
if (cdo_omp_get_thread_num() == 0) progress::update(0, 1, findex / gridsize2);
size_t ii, jj;
int lfound = rect_grid_search(&ii, &jj, x[i], y[i], nxm, nym, xm.data(), ym.data());
......@@ -284,7 +284,7 @@ intlinarr2(double missval, int lon_is_circular, size_t nxm, size_t nym, const do
}
}
Progress::update(0, 1, 1);
progress::update(0, 1, 1);
}
void
......
......@@ -108,7 +108,7 @@ remapBicubicWeights(RemapSearch &rsearch, RemapVars &rv)
double start = Options::cdoVerbose ? cdo_get_wtime() : 0;
Progress::init();
progress::init();
// Compute mappings from source to target grid
......@@ -130,7 +130,7 @@ remapBicubicWeights(RemapSearch &rsearch, RemapVars &rv)
#pragma omp atomic
#endif
findex++;
if (cdo_omp_get_thread_num() == 0) Progress::update(0, 1, findex / tgt_grid_size);
if (cdo_omp_get_thread_num() == 0) progress::update(0, 1, findex / tgt_grid_size);
weightLinks[tgt_cell_add].nlinks = 0;
......@@ -188,7 +188,7 @@ remapBicubicWeights(RemapSearch &rsearch, RemapVars &rv)
}
}
Progress::update(0, 1, 1);
progress::update(0, 1, 1);
weightLinks4ToRemapLinks(tgt_grid_size, weightLinks, rv);
......@@ -215,7 +215,7 @@ remapBicubic(RemapSearch &rsearch, const double *restrict src_array, double *res
double start = Options::cdoVerbose ? cdo_get_wtime() : 0;
Progress::init();
progress::init();
auto tgt_grid_size = tgt_grid->size;
auto src_grid_size = src_grid->size;
......@@ -247,7 +247,7 @@ remapBicubic(RemapSearch &rsearch, const double *restrict src_array, double *res
#pragma omp atomic
#endif
findex++;
if (cdo_omp_get_thread_num() == 0) Progress::update(0, 1, findex / tgt_grid_size);
if (cdo_omp_get_thread_num() == 0) progress::update(0, 1, findex / tgt_grid_size);
tgt_array[tgt_cell_add] = missval;
......@@ -307,7 +307,7 @@ remapBicubic(RemapSearch &rsearch, const double *restrict src_array, double *res
}
}
Progress::update(0, 1, 1);
progress::update(0, 1, 1);
if (Options::cdoVerbose) cdoPrint("Square search nearest: %.2f seconds", cdo_get_wtime() - start);
} // remapBicubic
......@@ -178,7 +178,7 @@ remapBilinearWeights(RemapSearch &rsearch, RemapVars &rv)
double start = Options::cdoVerbose ? cdo_get_wtime() : 0;
Progress::init();
progress::init();
// Compute mappings from source to target grid
......@@ -200,7 +200,7 @@ remapBilinearWeights(RemapSearch &rsearch, RemapVars &rv)
#pragma omp atomic
#endif
findex++;
if (cdo_omp_get_thread_num() == 0) Progress::update(0, 1, findex / tgt_grid_size);
if (cdo_omp_get_thread_num() == 0) progress::update(0, 1, findex / tgt_grid_size);
weightLinks[tgt_cell_add].nlinks = 0;
......@@ -258,7 +258,7 @@ remapBilinearWeights(RemapSearch &rsearch, RemapVars &rv)
}
}
Progress::update(0, 1, 1);
progress::update(0, 1, 1);
weightLinksToRemapLinks(0, tgt_grid_size, weightLinks, rv);
......@@ -278,7 +278,7 @@ remapBilinear(RemapSearch &rsearch, const double *restrict src_array, double *re
double start = Options::cdoVerbose ? cdo_get_wtime() : 0;
Progress::init();
progress::init();
auto tgt_grid_size = tgt_grid->size;
auto src_grid_size = src_grid->size;
......@@ -307,7 +307,7 @@ remapBilinear(RemapSearch &rsearch, const double *restrict src_array, double *re
#pragma omp atomic
#endif
findex++;
if (cdo_omp_get_thread_num() == 0) Progress::update(0, 1, findex / tgt_grid_size);
if (cdo_omp_get_thread_num() == 0) progress::update(0, 1, findex / tgt_grid_size);
tgt_array[tgt_cell_add] = missval;
......@@ -367,7 +367,7 @@ remapBilinear(RemapSearch &rsearch, const double *restrict src_array, double *re
}
}
Progress::update(0, 1, 1);
progress::update(0, 1, 1);
if (Options::cdoVerbose) cdoPrint("Square search nearest: %.2f seconds", cdo_get_wtime() - start);
} // remapBilinear
......@@ -491,7 +491,7 @@ remapConservWeights(RemapSearch &rsearch, RemapVars &rv)
if (Options::cdoVerbose) cdoPrint("Called %s()", __func__);
Progress::init();
progress::init();
double start = Options::cdoVerbose ? cdo_get_wtime() : 0;
......@@ -582,7 +582,7 @@ remapConservWeights(RemapSearch &rsearch, RemapVars &rv)
#pragma omp atomic
#endif
findex++;
if (ompthID == 0) Progress::update(0, 1, findex / tgt_grid_size);
if (ompthID == 0) progress::update(0, 1, findex / tgt_grid_size);
weightLinks[tgt_cell_add].nlinks = 0;
......@@ -720,7 +720,7 @@ remapConservWeights(RemapSearch &rsearch, RemapVars &rv)
storeWeightLinks(1, num_weights, srch_add[ompthID].data(), partial_weights, tgt_cell_add, weightLinks);
}
Progress::update(0, 1, 1);
progress::update(0, 1, 1);
if (1 && Options::cdoVerbose)
{
......@@ -780,7 +780,7 @@ remapConserv(NormOpt normOpt, RemapSearch &rsearch, const double *restrict src_a
if (Options::cdoVerbose) cdoPrint("Called %s()", __func__);
Progress::init();
progress::init();
double start = Options::cdoVerbose ? cdo_get_wtime() : 0;
......@@ -876,7 +876,7 @@ remapConserv(NormOpt normOpt, RemapSearch &rsearch, const double *restrict src_a
#pragma omp atomic
#endif
findex++;
if (ompthID == 0) Progress::update(0, 1, findex / tgt_grid_size);
if (ompthID == 0) progress::update(0, 1, findex / tgt_grid_size);
tgt_array[tgt_cell_add] = missval;
......@@ -1001,7 +1001,7 @@ remapConserv(NormOpt normOpt, RemapSearch &rsearch, const double *restrict src_a
}
}
Progress::update(0, 1, 1);
progress::update(0, 1, 1);
if (1 && Options::cdoVerbose)
{
......
......@@ -1245,7 +1245,7 @@ remapConservWeightsScrip(RemapSearch &rsearch, RemapVars &rv)
if (Options::cdoVerbose) cdoPrint("Called %s()", __func__);
Progress::init();
progress::init();
long num_wts = rv.num_wts;
......@@ -1317,7 +1317,7 @@ remapConservWeightsScrip(RemapSearch &rsearch, RemapVars &rv)
#pragma omp atomic
#endif
findex++;
if (ompthID == 0) Progress::update(0, 0.5, findex / src_grid_size);
if (ompthID == 0) progress::update(0, 0.5, findex / src_grid_size);
bool lcoinc; // flag for coincident segments
bool lthresh = false;
......@@ -1513,7 +1513,7 @@ remapConservWeightsScrip(RemapSearch &rsearch, RemapVars &rv)
#pragma omp atomic
#endif
findex++;
if (ompthID == 0) Progress::update(0.5, 0.5, findex / tgt_grid_size);
if (ompthID == 0) progress::update(0.5, 0.5, findex / tgt_grid_size);
bool lcoinc; // flag for coincident segments
bool lthresh = false;
......@@ -1671,7 +1671,7 @@ remapConservWeightsScrip(RemapSearch &rsearch, RemapVars &rv)
}
}
Progress::update(0, 1, 1);
progress::update(0, 1, 1);
/* Finished with all cells: deallocate search arrays */
......
......@@ -34,7 +34,7 @@ remapDistwgtWeights(size_t numNeighbors, RemapSearch &rsearch, RemapVars &rv)
if (Options::cdoVerbose) cdoPrint("Called %s()", __func__);
Progress::init();
progress::init();
// Compute mappings from source to target grid
......@@ -64,7 +64,7 @@ remapDistwgtWeights(size_t numNeighbors, RemapSearch &rsearch, RemapVars &rv)
#pragma omp atomic
#endif
findex++;
if (ompthID == 0) Progress::update(0, 1, findex / tgt_grid_size);
if (ompthID == 0) progress::update(0, 1, findex / tgt_grid_size);
weightLinks[tgt_cell_add].nlinks = 0;
......@@ -86,7 +86,7 @@ remapDistwgtWeights(size_t numNeighbors, RemapSearch &rsearch, RemapVars &rv)
storeWeightLinks(0, nadds, knnWeights[ompthID].m_addr.data(), knnWeights[ompthID].m_dist.data(), tgt_cell_add, weightLinks);
}
Progress::update(0, 1, 1);
progress::update(0, 1, 1);
gridPointSearchDelete(rsearch.gps);
......@@ -106,7 +106,7 @@ remapDistwgt(size_t numNeighbors, RemapSearch &rsearch, const double *restrict s
if (Options::cdoVerbose) cdoPrint("Called %s()", __func__);
Progress::init();
progress::init();
// Compute mappings from source to target grid
......@@ -140,7 +140,7 @@ remapDistwgt(size_t numNeighbors, RemapSearch &rsearch, const double *restrict s
#pragma omp atomic
#endif
findex++;
if (ompthID == 0) Progress::update(0, 1, findex / tgt_grid_size);
if (ompthID == 0) progress::update(0, 1, findex / tgt_grid_size);
tgt_array[tgt_cell_add] = missval;
......@@ -157,7 +157,7 @@ remapDistwgt(size_t numNeighbors, RemapSearch &rsearch, const double *restrict s
if (nadds) tgt_array[tgt_cell_add] = knnWeights[ompthID].arrayWeightsSum(src_array);
}
Progress::update(0, 1, 1);
progress::update(0, 1, 1);
if (Options::cdoVerbose) cdoPrint("Point search nearest: %.2f seconds", cdo_get_wtime() - start);
} // remapDistwgt
......@@ -177,7 +177,7 @@ intgriddis(Field &field1, Field &field2, size_t numNeighbors)
if (Options::cdoVerbose) cdoPrint("Called %s()", __func__);
Progress::init();
progress::init();
// Interpolate from source to target grid
......@@ -212,7 +212,7 @@ intgriddis(Field &field1, Field &field2, size_t numNeighbors)
const auto ompthID = cdo_omp_get_thread_num();
findex++;
if (ompthID == 0) Progress::update(0, 1, findex / tgt_grid_size);
if (ompthID == 0) progress::update(0, 1, findex / tgt_grid_size);
tgt_array[tgt_cell_add] = tgt_missval;
......@@ -232,7 +232,7 @@ intgriddis(Field &field1, Field &field2, size_t numNeighbors)
nmiss++;
}
Progress::update(0, 1, 1);
progress::update(0, 1, 1);
field2.nmiss = nmiss;
......
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