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

Use signed arithmetic in test data generator.

* This matches the array size type used in cdi.
parent 6cbe9bee
No related branches found
No related tags found
2 merge requests!34Version 2.2.0,!13Consolidation with CDI-PIO (develop)
......@@ -43,16 +43,16 @@ modelRegionCompute(double region[], int nlev, int nlat, int nlon, const int chun
const double lons[], const double lats[], double mscale, double mrscale)
{
(void) nlev;
unsigned is = (unsigned) chunkStart[0], js = (unsigned) chunkStart[1], ks = (unsigned) chunkStart[2], m = (unsigned) chunkSize[0],
n = (unsigned) chunkSize[1], o = (unsigned) chunkSize[2], jstride = (unsigned) chunkSize[0],
kstride = ((jstride * (unsigned) chunkSize[1] + nproma - 1) / nproma) * nproma;
int is = chunkStart[0], js = chunkStart[1], ks = chunkStart[2], m = chunkSize[0], n = chunkSize[1], o = chunkSize[2],
jstride = chunkSize[0], kstride = ((jstride * chunkSize[1] + nproma - 1) / nproma) * nproma;
for (unsigned k = 0; k < o; ++k)
for (unsigned j = 0; j < n; ++j)
for (unsigned i = 0; i < m; ++i)
tsID %= nlon;
for (int k = 0; k < o; ++k)
for (int j = 0; j < n; ++j)
for (int i = 0; i < m; ++i)
region[k * kstride + j * jstride + i]
= dg_wobble((lons[(i + is + (unsigned) tsID) % (unsigned) nlon] - lons[0]) / (lons[nlon - 1] - lons[0]),
(lats[(j + js + k + ks) % (unsigned) nlat] - lats[0]) / (lats[nlat - 1] - lats[0]), mscale, mrscale);
= dg_wobble((lons[(i + is + tsID) % nlon] - lons[0]) / (lons[nlon - 1] - lons[0]),
(lats[(j + js + k + ks) % nlat] - lats[0]) / (lats[nlat - 1] - lats[0]), mscale, mrscale);
}
#ifdef USE_MPI
......
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