Skip to content
Snippets Groups Projects
Commit 77f2f51c authored by Thomas Jahns's avatar Thomas Jahns :cartwheel: Committed by Sergey Kosukhin
Browse files

Make vectorization easier for compilers.

parent 24a08b6e
No related branches found
No related tags found
2 merge requests!34Version 2.2.0,!13Consolidation with CDI-PIO (develop)
......@@ -644,7 +644,7 @@ cdfDefAxisCommon(stream_t *streamptr, int gridID, int gridIndex, int ndims, bool
bool gen_bounds = false, hasBounds = gridInqPropPresence(gridID, gridAxisInq->bndsQueryKey);
const bool grid_is_cyclic = gridIsCircular(gridID) > 0;
double *pbounds;
double *restrict pbounds;
size_t nvertex = gridInqNvertex(gridID);
if (CDI_CMOR_Mode && grid_is_cyclic && !hasBounds)
{
......@@ -653,8 +653,8 @@ cdfDefAxisCommon(stream_t *streamptr, int gridID, int gridIndex, int ndims, bool
pbounds = (double *) Malloc(2 * dimlen * sizeof(double));
for (size_t i = 0; i < dimlen - 1; ++i)
{
pbounds[i * 2 + 1] = (pvals[i] + pvals[i + 1]) / 2;
pbounds[(i + 1) * 2] = (pvals[i] + pvals[i + 1]) / 2;
pbounds[i * 2 + 1] = (pvals[i] + pvals[i + 1]) * 0.5;
pbounds[i * 2 + 2] = (pvals[i] + pvals[i + 1]) * 0.5;
}
finishCyclicBounds(pbounds, dimlen, pvals);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment