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

after_fctrans.cc cleanup.

parent ae903d2f
......@@ -304,7 +304,7 @@ Ensstat3(void *process)
#endif
for (size_t i = 0; i < gridsize; i++)
{
const int ompthID = cdo_omp_get_thread_num();
const auto ompthID = cdo_omp_get_thread_num();
field[ompthID].missval = missval;
field[ompthID].nmiss = 0;
......
......@@ -120,25 +120,25 @@ rpassc(const double *a, const double *b, double *c, double *d, const double *tri
long lot, long n, long ifac, long la)
{
/*
rpassc - performs one pass through data as part of multiple real fft (fourier synthesis) routine;
rpassc - performs one pass through data as part of multiple real fft (fourier synthesis) routine
a is first real input vector
b is equivalent to a + la * inc1
c is first real output vector
d is equivalent to c + ifac * la * inc2
a is first real input vector
b is equivalent to a + la * inc1
c is first real output vector
d is equivalent to c + ifac * la * inc2
trigs is a precalculated list of sines & cosines
inc1 is the addressing increment for a;
inc2 is the addressing increment for c;
inc3 is the increment between input vectors a;
inc4 is the increment between output vectors c;
lot is the number of vectors;
n is the length of the vectors;
ifac is the current factor of n;
la is the product of previous factors;
ierr is an error indicator:;
0 - pass completed without error;
2 - ifac not catered for;
3 - ifac only catered for if la=n/ifac;
inc1 is the addressing increment for a
inc2 is the addressing increment for c
inc3 is the increment between input vectors a
inc4 is the increment between output vectors c
lot is the number of vectors
n is the length of the vectors
ifac is the current factor of n
la is the product of previous factors
ierr is an error indicator:
0 - pass completed without error
2 - ifac not catered for
3 - ifac only catered for if la=n/ifac
*/
long i0, i1, i2, i3, i4, i5, i6, i7;
......@@ -281,7 +281,6 @@ rpassc(const double *a, const double *b, double *c, double *d, const double *tri
}
return 0;
}
case 3:
{
double afa1, a1p2, a1m2, a0mm, a0mp;
......@@ -421,7 +420,6 @@ rpassc(const double *a, const double *b, double *c, double *d, const double *tri
}
return 0;
}
case 4:
{
double a0m1, a0p2, a1p3, a0m2, a1m3, a0p2ma1p3, a0m2pb1p3, a0m2mb1p3;
......@@ -579,7 +577,6 @@ rpassc(const double *a, const double *b, double *c, double *d, const double *tri
}
return 0;
}
case 5:
{
double a1p2, a1m2, a0mm, a0mp, b136, b172, b236, b272;
......@@ -757,7 +754,6 @@ rpassc(const double *a, const double *b, double *c, double *d, const double *tri
}
return 0;
}
case 6:
{
ia = 0;
......@@ -927,7 +923,6 @@ rpassc(const double *a, const double *b, double *c, double *d, const double *tri
}
return 0;
}
case 8:
{
double a0p7, a1p5, a2p6, p073, p074, p152;
......@@ -1001,7 +996,7 @@ qpassc(const double *a, const double *b, double *c, double *d, const double *tri
long lot, long n, long ifac, long la)
{
/*
qpassc - performs one pass through data as part of multiple real fft (fourier analysis) routine.
qpassc - performs one pass through data as part of multiple real fft (fourier analysis) routine
a is first real input vector
b is equivalent to a + ifac * la * inc1
......@@ -1150,7 +1145,6 @@ qpassc(const double *a, const double *b, double *c, double *d, const double *tri
}
return 0;
}
case 3:
{
ia = 0;
......@@ -1280,7 +1274,6 @@ qpassc(const double *a, const double *b, double *c, double *d, const double *tri
}
return 0;
}
case 4:
{
double a0p2, a1p3;
......@@ -1431,7 +1424,6 @@ qpassc(const double *a, const double *b, double *c, double *d, const double *tri
}
return 0;
}
case 5:
{
double a1p4, a2p3, b1p4, b2p3, a025, b025, asps, bsps, a0pq, b0pq;
......@@ -1631,7 +1623,6 @@ qpassc(const double *a, const double *b, double *c, double *d, const double *tri
}
return 0;
}
case 6:
{
double ab1a, ab2a, ab3a, ab4a, ab5a;
......@@ -1851,7 +1842,6 @@ qpassc(const double *a, const double *b, double *c, double *d, const double *tri
}
return 0;
}
case 8:
{
double a0p4, a1p5, a2p6, a3p7;
......@@ -1984,7 +1974,7 @@ fc2gp(double *restrict trig, const long *restrict ifax, double *restrict fc, dou
#endif
for (long nb = 0; nb < nblox; nb++)
{
const int ompthID = cdo_omp_get_thread_num();
const auto ompthID = cdo_omp_get_thread_num();
double *restrict wgp = &wgp2d[ompthID][0];
const long istart = istartv[nb];
......
......@@ -362,7 +362,7 @@ after_legini(long ntr, long nlat, double *restrict poli, double *restrict pold,
for (long jgl = 0; jgl < nlat / 2; jgl++)
{
#ifdef _OPENMP
const int ompthID = cdo_omp_get_thread_num();
const auto ompthID = cdo_omp_get_thread_num();
double *pnm = pnm2[ompthID].data();
double *work = work2[ompthID].data();
#endif
......
......@@ -623,7 +623,7 @@ hetaeta(bool ltq, int ngp, const int *imiss, int nlev1, const double *ah1, const
#endif
for (int ij = 0; ij < ngp; ++ij)
{
int ompthID = cdo_omp_get_thread_num();
auto ompthID = cdo_omp_get_thread_num();
for (int iv = 0; iv < nvars; ++iv) vars_pbl[iv] = &vars_pbl_2[ompthID][iv][0];
......
......@@ -577,7 +577,7 @@ remapConservWeights(RemapSearch &rsearch, RemapVars &rv)
double partial_weight;
size_t src_cell_add; // current linear address for source grid cell
size_t num_weights, num_weights_old;
const int ompthID = cdo_omp_get_thread_num();
const auto ompthID = cdo_omp_get_thread_num();
#ifdef _OPENMP
#pragma omp atomic
......@@ -731,7 +731,7 @@ remapConservWeights(RemapSearch &rsearch, RemapVars &rv)
// Finished with all cells: deallocate search arrays
for (int ompthID = 0; ompthID < Threading::ompNumThreads; ++ompthID)
for (auto ompthID = 0; ompthID < Threading::ompNumThreads; ++ompthID)
{
cellSearchFree(search[ompthID]);
yacGridCellFree(tgt_grid_cell[ompthID]);
......@@ -870,7 +870,7 @@ remapConserv(NormOpt normOpt, RemapSearch &rsearch, const double *restrict src_a
{
size_t src_cell_add; // current linear address for source grid cell
size_t num_weights, num_weights_old;
const int ompthID = cdo_omp_get_thread_num();
const auto ompthID = cdo_omp_get_thread_num();
#ifdef _OPENMP
#pragma omp atomic
......@@ -1011,7 +1011,7 @@ remapConserv(NormOpt normOpt, RemapSearch &rsearch, const double *restrict src_a
// Finished with all cells: deallocate search arrays
for (int ompthID = 0; ompthID < Threading::ompNumThreads; ++ompthID)
for (auto ompthID = 0; ompthID < Threading::ompNumThreads; ++ompthID)
{
cellSearchFree(search[ompthID]);
yacGridCellFree(tgt_grid_cell[ompthID]);
......
......@@ -1313,7 +1313,7 @@ remapConservWeightsScrip(RemapSearch &rsearch, RemapVars &rv)
#endif
for (long src_cell_add = 0; src_cell_add < src_grid_size; ++src_cell_add)
{
int ompthID = cdo_omp_get_thread_num();
auto ompthID = cdo_omp_get_thread_num();
#ifdef _OPENMP
#pragma omp atomic
......@@ -1509,7 +1509,7 @@ remapConservWeightsScrip(RemapSearch &rsearch, RemapVars &rv)
#endif
for (long tgt_cell_add = 0; tgt_cell_add < tgt_grid_size; ++tgt_cell_add)
{
int ompthID = cdo_omp_get_thread_num();
auto ompthID = cdo_omp_get_thread_num();
#ifdef _OPENMP
#pragma omp atomic
......
......@@ -59,7 +59,7 @@ remapDistwgtWeights(size_t numNeighbors, RemapSearch &rsearch, RemapVars &rv)
#endif
for (size_t tgt_cell_add = 0; tgt_cell_add < tgt_grid_size; ++tgt_cell_add)
{
const int ompthID = cdo_omp_get_thread_num();
const auto ompthID = cdo_omp_get_thread_num();
#ifdef _OPENMP
#pragma omp atomic
......@@ -137,7 +137,7 @@ remapDistwgt(size_t numNeighbors, RemapSearch &rsearch, const double *restrict s
#endif
for (size_t tgt_cell_add = 0; tgt_cell_add < tgt_grid_size; ++tgt_cell_add)
{
const int ompthID = cdo_omp_get_thread_num();
const auto ompthID = cdo_omp_get_thread_num();
#ifdef _OPENMP
#pragma omp atomic
......@@ -212,7 +212,7 @@ intgriddis(Field &field1, Field &field2, size_t numNeighbors)
for (size_t tgt_cell_add = 0; tgt_cell_add < tgt_grid_size; ++tgt_cell_add)
{
const int ompthID = cdo_omp_get_thread_num();
const auto ompthID = cdo_omp_get_thread_num();
findex++;
if (ompthID == 0) Progress::update(0, 1, findex / tgt_grid_size);
......
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