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

omp parallel: default(none) cleanup

parent 14ae8f74
......@@ -83,7 +83,6 @@ static
int genGrid(int nfiles, ens_file_t *ef, int **gridindex, int igrid, int nxblocks)
{
int lsouthnorth = TRUE;
int fileID;
int gridID2 = -1;
int idx;
int nx, ny, ix, iy, i, j, ij, offset;
......@@ -102,7 +101,7 @@ int genGrid(int nfiles, ens_file_t *ef, int **gridindex, int igrid, int nxblocks
double **xvals = (double**) Malloc(nfiles*sizeof(double*));
double **yvals = (double**) Malloc(nfiles*sizeof(double*));
for ( fileID = 0; fileID < nfiles; fileID++ )
for ( int fileID = 0; fileID < nfiles; fileID++ )
{
gridID = vlistGrid(ef[fileID].vlistID, igrid);
gridtype = gridInqType(gridID);
......@@ -155,7 +154,7 @@ int genGrid(int nfiles, ens_file_t *ef, int **gridindex, int igrid, int nxblocks
}
if ( cdoVerbose )
for ( fileID = 0; fileID < nfiles; fileID++ )
for ( int fileID = 0; fileID < nfiles; fileID++ )
printf("1 %d %g %g \n", xyinfo[fileID].id, xyinfo[fileID].x, xyinfo[fileID].y);
if ( lregular )
......@@ -163,7 +162,7 @@ int genGrid(int nfiles, ens_file_t *ef, int **gridindex, int igrid, int nxblocks
qsort(xyinfo, nfiles, sizeof(xyinfo_t), cmpx);
if ( cdoVerbose )
for ( fileID = 0; fileID < nfiles; fileID++ )
for ( int fileID = 0; fileID < nfiles; fileID++ )
printf("2 %d %g %g \n", xyinfo[fileID].id, xyinfo[fileID].x, xyinfo[fileID].y);
if ( lsouthnorth )
......@@ -172,11 +171,11 @@ int genGrid(int nfiles, ens_file_t *ef, int **gridindex, int igrid, int nxblocks
qsort(xyinfo, nfiles, sizeof(xyinfo_t), cmpxy_gt);
if ( cdoVerbose )
for ( fileID = 0; fileID < nfiles; fileID++ )
for ( int fileID = 0; fileID < nfiles; fileID++ )
printf("3 %d %g %g \n", xyinfo[fileID].id, xyinfo[fileID].x, xyinfo[fileID].y);
nx = 1;
for ( fileID = 1; fileID < nfiles; fileID++ )
for ( int fileID = 1; fileID < nfiles; fileID++ )
{
if ( DBL_IS_EQUAL(xyinfo[0].y, xyinfo[fileID].y) ) nx++;
else break;
......@@ -229,7 +228,7 @@ int genGrid(int nfiles, ens_file_t *ef, int **gridindex, int igrid, int nxblocks
if ( gridindex != NULL )
{
for ( fileID = 0; fileID < nfiles; fileID++ )
for ( int fileID = 0; fileID < nfiles; fileID++ )
{
idx = xyinfo[fileID].id;
iy = fileID/nx;
......@@ -286,7 +285,7 @@ int genGrid(int nfiles, ens_file_t *ef, int **gridindex, int igrid, int nxblocks
gridInqYunits(gridID, string);
gridDefYunits(gridID2, string);
for ( fileID = 0; fileID < nfiles; fileID++ )
for ( int fileID = 0; fileID < nfiles; fileID++ )
{
if ( xvals[fileID] ) Free(xvals[fileID]);
if ( yvals[fileID] ) Free(yvals[fileID]);
......@@ -306,7 +305,6 @@ void *Collgrid(void *argument)
int nrecs, nrecs0;
int levelID;
int nmiss;
int fileID;
double missval;
cdoInitialize(argument);
......@@ -321,7 +319,7 @@ void *Collgrid(void *argument)
ens_file_t *ef = (ens_file_t*) Malloc(nfiles*sizeof(ens_file_t));
for ( fileID = 0; fileID < nfiles; fileID++ )
for ( int fileID = 0; fileID < nfiles; fileID++ )
{
ef[fileID].streamID = streamOpenRead(cdoStreamName(fileID));
ef[fileID].vlistID = streamInqVlist(ef[fileID].streamID);
......@@ -331,7 +329,7 @@ void *Collgrid(void *argument)
vlistClearFlag(vlistID1);
/* check that the contents is always the same */
for ( fileID = 1; fileID < nfiles; fileID++ )
for ( int fileID = 1; fileID < nfiles; fileID++ )
vlistCompare(vlistID1, ef[fileID].vlistID, CMP_NAME | CMP_NLEVEL);
int nvars = vlistNvars(vlistID1);
......@@ -404,13 +402,13 @@ void *Collgrid(void *argument)
int gridsize;
int gridsizemax = 0;
for ( fileID = 0; fileID < nfiles; fileID++ )
for ( int fileID = 0; fileID < nfiles; fileID++ )
{
gridsize = vlistGridsizeMax(ef[fileID].vlistID);
if ( gridsize > gridsizemax ) gridsizemax = gridsize;
}
for ( fileID = 0; fileID < nfiles; fileID++ )
for ( int fileID = 0; fileID < nfiles; fileID++ )
ef[fileID].array = (double*) Malloc(gridsizemax*sizeof(double));
......@@ -433,7 +431,7 @@ void *Collgrid(void *argument)
int *gridIDs = (int*) Malloc(ngrids2*sizeof(int));
int **gridindex = (int **) Malloc(nfiles*sizeof(int *));
for ( fileID = 0; fileID < nfiles; fileID++ )
for ( int fileID = 0; fileID < nfiles; fileID++ )
gridindex[fileID] = (int*) Malloc(gridsizemax*sizeof(int));
int ginit = FALSE;
......@@ -495,7 +493,7 @@ void *Collgrid(void *argument)
do
{
nrecs0 = streamInqTimestep(ef[0].streamID, tsID);
for ( fileID = 1; fileID < nfiles; fileID++ )
for ( int fileID = 1; fileID < nfiles; fileID++ )
{
nrecs = streamInqTimestep(ef[fileID].streamID, tsID);
if ( nrecs != nrecs0 )
......@@ -511,7 +509,7 @@ void *Collgrid(void *argument)
streamInqRecord(ef[0].streamID, &varID, &levelID);
if ( cdoVerbose && tsID == 0 ) printf(" tsID, recID, varID, levelID %d %d %d %d\n", tsID, recID, varID, levelID);
for ( fileID = 0; fileID < nfiles; fileID++ )
for ( int fileID = 0; fileID < nfiles; fileID++ )
{
int varIDx, levelIDx;
if ( fileID > 0 ) streamInqRecord(ef[fileID].streamID, &varIDx, &levelIDx);
......@@ -527,9 +525,9 @@ void *Collgrid(void *argument)
for ( int i = 0; i < gridsize2; i++ ) array2[i] = missval;
#if defined(_OPENMP)
#pragma omp parallel for default(shared) private(fileID, nmiss)
#pragma omp parallel for default(shared) private(nmiss)
#endif
for ( fileID = 0; fileID < nfiles; fileID++ )
for ( int fileID = 0; fileID < nfiles; fileID++ )
{
streamReadRecord(ef[fileID].streamID, ef[fileID].array, &nmiss);
......@@ -560,12 +558,12 @@ void *Collgrid(void *argument)
}
while ( nrecs0 > 0 );
for ( fileID = 0; fileID < nfiles; fileID++ )
for ( int fileID = 0; fileID < nfiles; fileID++ )
streamClose(ef[fileID].streamID);
streamClose(streamID2);
for ( fileID = 0; fileID < nfiles; fileID++ )
for ( int fileID = 0; fileID < nfiles; fileID++ )
if ( ef[fileID].array ) Free(ef[fileID].array);
if ( ef ) Free(ef);
......
......@@ -70,14 +70,10 @@ void *Detrend(void *argument)
int gridsize;
int nrecs;
int gridID, varID, levelID, recID;
int tsID;
int i;
int nts;
int nalloc = 0;
int streamID1, streamID2;
int vlistID1, vlistID2, taxisID1, taxisID2;
int nmiss;
int nvars, nlevel;
int nlevel;
double missval;
field_t ***vars = NULL;
dtlist_type *dtlist = dtlist_new();
......@@ -86,26 +82,25 @@ void *Detrend(void *argument)
double *array1;
double *array2;
} memory_t;
memory_t *ompmem = NULL;
cdoInitialize(argument);
streamID1 = streamOpenRead(cdoStreamName(0));
int streamID1 = streamOpenRead(cdoStreamName(0));
vlistID1 = streamInqVlist(streamID1);
vlistID2 = vlistDuplicate(vlistID1);
int vlistID1 = streamInqVlist(streamID1);
int vlistID2 = vlistDuplicate(vlistID1);
taxisID1 = vlistInqTaxis(vlistID1);
taxisID2 = taxisDuplicate(taxisID1);
int taxisID1 = vlistInqTaxis(vlistID1);
int taxisID2 = taxisDuplicate(taxisID1);
vlistDefTaxis(vlistID2, taxisID2);
streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
int streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
streamDefVlist(streamID2, vlistID2);
nvars = vlistNvars(vlistID1);
int nvars = vlistNvars(vlistID1);
tsID = 0;
int tsID = 0;
while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
{
if ( tsID >= nalloc )
......@@ -131,9 +126,9 @@ void *Detrend(void *argument)
tsID++;
}
nts = tsID;
int nts = tsID;
ompmem = (memory_t*) Malloc(ompNumThreads*sizeof(memory_t));
memory_t *ompmem = (memory_t*) Malloc(ompNumThreads*sizeof(memory_t));
for ( i = 0; i < ompNumThreads; i++ )
{
ompmem[i].array1 = (double*) Malloc(nts*sizeof(double));
......@@ -149,18 +144,18 @@ void *Detrend(void *argument)
for ( levelID = 0; levelID < nlevel; levelID++ )
{
#if defined(_OPENMP)
#pragma omp parallel for default(shared) private(i, tsID)
#pragma omp parallel for default(none) shared(ompmem, vars, varID, levelID, gridsize, nts, missval)
#endif
for ( i = 0; i < gridsize; i++ )
{
int ompthID = cdo_omp_get_thread_num();
for ( tsID = 0; tsID < nts; tsID++ )
for ( int tsID = 0; tsID < nts; tsID++ )
ompmem[ompthID].array1[tsID] = vars[tsID][varID][levelID].ptr[i];
detrend(nts, missval, ompmem[ompthID].array1, ompmem[ompthID].array2);
for ( tsID = 0; tsID < nts; tsID++ )
for ( int tsID = 0; tsID < nts; tsID++ )
vars[tsID][varID][levelID].ptr[i] = ompmem[ompthID].array2[tsID];
}
}
......@@ -173,7 +168,7 @@ void *Detrend(void *argument)
}
Free(ompmem);
for ( tsID = 0; tsID < nts; tsID++ )
for ( int tsID = 0; tsID < nts; tsID++ )
{
dtlist_taxisDefTimestep(dtlist, taxisID2, tsID);
streamDefTimestep(streamID2, tsID);
......
......@@ -54,7 +54,7 @@ void scale_eigvec_time(double *restrict out, int tsID, int nts, int npack, const
double **covar, double **data, double missval, double sum_w)
{
#if defined(_OPENMP)
#pragma omp parallel for shared(tsID, data, out)
#pragma omp parallel for default(none) shared(npack, nts, tsID, pack, data, covar, out)
#endif
for ( int i = 0; i < npack; ++i )
{
......@@ -81,7 +81,7 @@ void scale_eigvec_time(double *restrict out, int tsID, int nts, int npack, const
#endif
for ( int i = 0; i < npack; ++i )
{
// do not need to account for weights as eigenvectors are non-weighted
// do not need to account for weights as eigenvectors are non-weighted
sum += weight[pack[i]] * out[pack[i]] * out[pack[i]];
}
......
......@@ -47,7 +47,6 @@ void *Ensstat(void *argument)
int levelID = 0;
int streamID = 0;
int nmiss;
int fileID;
double missval;
typedef struct
{
......@@ -113,17 +112,17 @@ void *Ensstat(void *argument)
field[i].size = nfiles;
field[i].ptr = (double*) Malloc(nfiles*sizeof(double));
field[i].weight = (double*) Malloc(nfiles*sizeof(double));
for ( fileID = 0; fileID < nfiles; fileID++ ) field[i].weight[fileID] = 1;
for ( int fileID = 0; fileID < nfiles; fileID++ ) field[i].weight[fileID] = 1;
}
for ( fileID = 0; fileID < nfiles; fileID++ )
for ( int fileID = 0; fileID < nfiles; fileID++ )
{
ef[fileID].streamID = streamOpenRead(cdoStreamName(fileID));
ef[fileID].vlistID = streamInqVlist(ef[fileID].streamID);
}
/* check that the contents is always the same */
for ( fileID = 1; fileID < nfiles; fileID++ )
for ( int fileID = 1; fileID < nfiles; fileID++ )
vlistCompare(ef[0].vlistID, ef[fileID].vlistID, CMP_ALL);
int vlistID1 = ef[0].vlistID;
......@@ -134,7 +133,7 @@ void *Ensstat(void *argument)
int gridsize = vlistGridsizeMax(vlistID1);
for ( fileID = 0; fileID < nfiles; fileID++ )
for ( int fileID = 0; fileID < nfiles; fileID++ )
ef[fileID].array = (double*) Malloc(gridsize*sizeof(double));
double *array2 = (double *) Malloc(gridsize*sizeof(double));
......@@ -167,7 +166,7 @@ void *Ensstat(void *argument)
do
{
nrecs0 = streamInqTimestep(ef[0].streamID, tsID);
for ( fileID = 1; fileID < nfiles; fileID++ )
for ( int fileID = 1; fileID < nfiles; fileID++ )
{
streamID = ef[fileID].streamID;
nrecs = streamInqTimestep(streamID, tsID);
......@@ -190,10 +189,11 @@ void *Ensstat(void *argument)
for ( recID = 0; recID < nrecs0; recID++ )
{
#if defined(_OPENMP)
#pragma omp parallel for default(shared) private(fileID, streamID, nmiss) \
#pragma omp parallel for default(none) shared(ef, nfiles) \
private(streamID, nmiss) \
lastprivate(varID, levelID)
#endif
for ( fileID = 0; fileID < nfiles; fileID++ )
for ( int fileID = 0; fileID < nfiles; fileID++ )
{
streamID = ef[fileID].streamID;
streamInqRecord(streamID, &varID, &levelID);
......@@ -207,7 +207,7 @@ void *Ensstat(void *argument)
nmiss = 0;
#if defined(_OPENMP)
#pragma omp parallel for default(shared) private(i, fileID)
#pragma omp parallel for default(shared)
#endif
for ( i = 0; i < gridsize; ++i )
{
......@@ -215,7 +215,7 @@ void *Ensstat(void *argument)
field[ompthID].missval = missval;
field[ompthID].nmiss = 0;
for ( fileID = 0; fileID < nfiles; fileID++ )
for ( int fileID = 0; fileID < nfiles; fileID++ )
{
field[ompthID].ptr[fileID] = ef[fileID].array[i];
if ( DBL_IS_EQUAL(field[ompthID].ptr[fileID], ef[fileID].missval) )
......@@ -255,12 +255,12 @@ void *Ensstat(void *argument)
}
while ( nrecs0 > 0 );
for ( fileID = 0; fileID < nfiles; fileID++ )
for ( int fileID = 0; fileID < nfiles; fileID++ )
streamClose(ef[fileID].streamID);
streamClose(streamID2);
for ( fileID = 0; fileID < nfiles; fileID++ )
for ( int fileID = 0; fileID < nfiles; fileID++ )
if ( ef[fileID].array ) Free(ef[fileID].array);
if ( ef ) Free(ef);
......
......@@ -77,7 +77,6 @@ void *Ensstat3(void *argument)
double val;
int ival;
field_t *field;
int fileID;
const char *ofilename;
typedef struct
......@@ -131,11 +130,11 @@ void *Ensstat3(void *argument)
field[i].size = nfiles;
field[i].ptr = (double*) Malloc(nfiles*sizeof(double));
field[i].weight = (double*) Malloc(nfiles*sizeof(double));
for ( fileID = 0; fileID < nfiles; fileID++ )
for ( int fileID = 0; fileID < nfiles; fileID++ )
field[i].weight[fileID] = 1;
}
for ( fileID = 0; fileID < nfiles; fileID++ )
for ( int fileID = 0; fileID < nfiles; fileID++ )
{
streamID = streamOpenRead(cdoStreamName(fileID));
......@@ -146,7 +145,7 @@ void *Ensstat3(void *argument)
}
/* check for identical contents of all ensemble members */
for ( fileID = 1; fileID < nfiles; fileID++ )
for ( int fileID = 1; fileID < nfiles; fileID++ )
vlistCompare(ef[0].vlistID, ef[fileID].vlistID, CMP_ALL);
vlistID1 = ef[0].vlistID;
......@@ -207,7 +206,7 @@ void *Ensstat3(void *argument)
gridsize = vlistGridsizeMax(vlistID1);
for ( fileID = 0; fileID < nfiles; fileID++ )
for ( int fileID = 0; fileID < nfiles; fileID++ )
ef[fileID].array = (double*) Malloc(gridsize*sizeof(double));
if ( operfunc == func_rank && datafunc == SPACE )
......@@ -246,7 +245,7 @@ void *Ensstat3(void *argument)
do
{
nrecs0 = streamInqTimestep(ef[0].streamID, tsID);
for ( fileID = 1; fileID < nfiles; fileID++ )
for ( int fileID = 1; fileID < nfiles; fileID++ )
{
streamID = ef[fileID].streamID;
nrecs = streamInqTimestep(streamID, tsID);
......@@ -271,10 +270,11 @@ void *Ensstat3(void *argument)
for ( recID = 0; recID < nrecs0; recID++ )
{
#if defined(_OPENMP)
#pragma omp parallel for default(shared) private(fileID, streamID, nmiss) \
lastprivate(varID, levelID)
#pragma omp parallel for default(none) shared(ef, nfiles) \
private(streamID, nmiss) \
lastprivate(varID, levelID)
#endif
for ( fileID = 0; fileID < nfiles; fileID++ )
for ( int fileID = 0; fileID < nfiles; fileID++ )
{
streamID = ef[fileID].streamID;
streamInqRecord(streamID, &varID, &levelID);
......@@ -291,7 +291,7 @@ void *Ensstat3(void *argument)
array2[binID][0] = 0;
#if defined(_OPENMP)
#pragma omp parallel for default(shared) private(i, binID, fileID)
#pragma omp parallel for default(shared) private(binID)
#endif
for ( i = 0; i < gridsize; i++ )
{
......@@ -300,7 +300,7 @@ void *Ensstat3(void *argument)
field[ompthID].missval = missval;
field[ompthID].nmiss = 0;
have_miss = 0;
for ( fileID = 0; fileID < nfiles; fileID++ )
for ( int fileID = 0; fileID < nfiles; fileID++ )
{
field[ompthID].ptr[fileID] = ef[fileID].array[i];
if ( DBL_IS_EQUAL(field[ompthID].ptr[fileID], missval) )
......@@ -478,7 +478,7 @@ void *Ensstat3(void *argument)
roc_curve_integrate((const double **)roc,nbins));
}
for ( fileID = 0; fileID < nfiles; fileID++ )
for ( int fileID = 0; fileID < nfiles; fileID++ )
{
streamID = ef[fileID].streamID;
streamClose(streamID);
......@@ -487,7 +487,7 @@ void *Ensstat3(void *argument)
if ( operfunc != func_roc )
streamClose(streamID2);
for ( fileID = 0; fileID < nfiles; fileID++ )
for ( int fileID = 0; fileID < nfiles; fileID++ )
if ( ef[fileID].array ) Free(ef[fileID].array);
if ( ef ) Free(ef);
......
......@@ -337,7 +337,7 @@ void *EOF3d(void * argument)
double *eigenvec = eigenvectors[varID][eofID];
#if defined(_OPENMP)
#pragma omp parallel for private(i,j,sum) shared(datafields, eigenvec)
#pragma omp parallel for default(none) private(j,sum) shared(varID,nts,eofID,npack,pack,cov,datafields,eigenvec)
#endif
for ( i = 0; i < npack; i++ )
{
......@@ -351,8 +351,7 @@ void *EOF3d(void * argument)
sum = 0;
#if defined(_OPENMP)
#pragma omp parallel for private(i) default(none) reduction(+:sum) \
shared(eigenvec,weight,pack,npack,gridsize)
#pragma omp parallel for default(none) shared(eigenvec,weight,pack,npack,gridsize) reduction(+:sum)
#endif
for ( i = 0; i < npack; i++ )
sum += weight[pack[i]%gridsize] *
......@@ -362,8 +361,7 @@ void *EOF3d(void * argument)
{
sum = sqrt(sum);
#if defined(_OPENMP)
#pragma omp parallel for private(i) default(none) \
shared(sum,npack,eigenvec,pack)
#pragma omp parallel for default(none) shared(sum,npack,eigenvec,pack)
#endif
for( i = 0; i < npack; i++ )
eigenvec[pack[i]] /= sum;
......@@ -371,8 +369,7 @@ void *EOF3d(void * argument)
else
{
#if defined(_OPENMP)
#pragma omp parallel for private(i) default(none) \
shared(eigenvec,pack,missval,npack)
#pragma omp parallel for default(none) shared(eigenvec,pack,missval,npack)
#endif
for( i = 0; i < npack; i++ )
eigenvec[pack[i]] = missval;
......
......@@ -357,8 +357,7 @@ void setmisstonn(field_t *field1, field_t *field2, int maxfill)
double search_radius = remap_search_radius*DEG2RAD;
double range = SQR(2*search_radius);
unsigned index;
#pragma omp parallel for private(index) shared(findex, mindex, array1, array2, xvals, yvals, range)
#pragma omp parallel for default(none) shared(findex, mindex, vindex, array1, array2, xvals, yvals, range, gs, nmiss)
for ( unsigned i = 0; i < nmiss; ++i )
{
#if defined(_OPENMP)
......@@ -368,8 +367,7 @@ void setmisstonn(field_t *field1, field_t *field2, int maxfill)
if ( cdo_omp_get_thread_num() == 0 ) progressStatus(0, 1, findex/nmiss);
double prange = range;
index = gridsearch_nearest(gs, xvals[mindex[i]], yvals[mindex[i]], &prange);
unsigned index = gridsearch_nearest(gs, xvals[mindex[i]], yvals[mindex[i]], &prange);
if ( index == GS_NOT_FOUND ) index = mindex[i];
else index = vindex[index];
......
......@@ -65,12 +65,10 @@ void create_fmasc(int nts, double fdata, double fmin, double fmax, int *fmasc)
#if defined(HAVE_LIBFFTW3)
static
void filter_fftw(int nts, const int *fmasc, fftw_complex *fft_out, fftw_plan *p_T2S, fftw_plan *p_S2T)
{
int i;
{
fftw_execute(*p_T2S);
for ( i = 0; i < nts; i++ )
for ( int i = 0; i < nts; i++ )
if ( ! fmasc[i] )
{
fft_out[i][0] = 0;
......@@ -86,7 +84,6 @@ void filter_fftw(int nts, const int *fmasc, fftw_complex *fft_out, fftw_plan *p_
static
void filter_intrinsic(int nts, const int *fmasc, double *array1, double *array2)
{
int i;
int lpower2 = FALSE;
double *work_r = NULL;
double *work_i = NULL;
......@@ -104,7 +101,7 @@ void filter_intrinsic(int nts, const int *fmasc, double *array1, double *array2)
else
ft_r(array1, array2, nts, 1, work_r, work_i);
for ( i = 0; i < nts; i++ )
for ( int i = 0; i < nts; i++ )
if ( ! fmasc[i] )
array1[i] = array2[i] = 0;
......@@ -123,13 +120,12 @@ void filter_intrinsic(int nts, const int *fmasc, double *array1, double *array2)
void *Filter(void *argument)
{
enum {BANDPASS, HIGHPASS, LOWPASS};
char *tunits[] = {"second", "minute", "hour", "day", "month", "year"};
const char *tunits[] = {"second", "minute", "hour", "day", "month", "year"};
int iunits[] = {31536000, 525600, 8760, 365, 12, 1};
int gridsize;
int nrecs;
int gridID, varID, levelID, recID;
int tsID;
int i;
int nts;
int nalloc = 0;
int nmiss;
......@@ -263,7 +259,7 @@ void *Filter(void *argument)
{
#if defined(HAVE_LIBFFTW3)
ompmem = (memory_t*) Malloc(ompNumThreads*sizeof(memory_t));
for ( i = 0; i < ompNumThreads; i++ )
for ( int i = 0; i < ompNumThreads; i++ )
{
ompmem[i].in_fft = (fftw_complex*) Malloc(nts*sizeof(fftw_complex));
ompmem[i].out_fft = (fftw_complex*) Malloc(nts*sizeof(fftw_complex));
......@@ -275,7 +271,7 @@ void *Filter(void *argument)
else
{
ompmem = (memory_t*) Malloc(ompNumThreads*sizeof(memory_t));
for ( i = 0; i < ompNumThreads; i++ )
for ( int i = 0; i < ompNumThreads; i++ )
{
ompmem[i].array1 = (double*) Malloc(nts*sizeof(double));
ompmem[i].array2 = (double*) Malloc(nts*sizeof(double));
......@@ -328,9 +324,9 @@ void *Filter(void *argument)
{
#if defined(HAVE_LIBFFTW3)
#if defined(_OPENMP)
#pragma omp parallel for default(shared) private(i, tsID)
#pragma omp parallel for default(shared) private(tsID)
#endif
for ( i = 0; i < gridsize; i++ )
for ( int i = 0; i < gridsize; i++ )
{
int ompthID = cdo_omp_get_thread_num();
......@@ -352,9 +348,9 @@ void *Filter(void *argument)
else
{
#if defined(_OPENMP)
#pragma omp parallel for default(shared) private(i, tsID)
#pragma omp parallel for default(shared) private(tsID)
#endif
for ( i = 0; i < gridsize; i++ )
for ( int i = 0; i < gridsize; i++ )
{
int ompthID = cdo_omp_get_thread_num();
......@@ -375,7 +371,7 @@ void *Filter(void *argument)
if ( use_fftw )
{
#if defined(HAVE_LIBFFTW3)
for ( i = 0; i < ompNumThreads; i++ )
for ( int i = 0; i < ompNumThreads; i++ )
{
Free(ompmem[i].in_fft);
Free(ompmem[i].out_fft);
......@@ -385,7 +381,7 @@ void *Filter(void *argument)
}
else
{
for ( i = 0; i < ompNumThreads; i++ )
for ( int i = 0; i < ompNumThreads; i++ )
{
Free(ompmem[i].array1);
Free(ompmem[i].array2);
......
......@@ -33,7 +33,6 @@ void *Fourier(void *argument)
int nrecs;
int gridID, varID, levelID, recID;
int tsID;
int i;
int nts;