Commit 5001237c authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

inserted a brace around the lsestructure of popenmp for loop

parent 6c404cc9
......@@ -472,22 +472,25 @@ void *EOF3d(void * argument)
// sum += weight[pack[i]%gridsize] *
sum += eigenvec[pack[i]] * eigenvec[pack[i]];
if ( sum > 0 ) {
sum = sqrt(sum);
if ( sum > 0 )
{
sum = sqrt(sum);
#if defined(_OPENMP)
#pragma omp parallel for private(i) default(none) \
shared(sum,npack,eigenvec,pack)
#endif
for( i = 0; i < npack; i++ )
eigenvec[pack[i]] /= sum;
}
for( i = 0; i < npack; i++ )
eigenvec[pack[i]] /= sum;
}
else
{
#if defined(_OPENMP)
#pragma omp parallel for private(i) default(none) \
shared(eigenvec,pack,missval,npack)
#endif
for( i = 0; i < npack; i++ )
eigenvec[pack[i]] = missval;
for( i = 0; i < npack; i++ )
eigenvec[pack[i]] = missval;
}
} /* for ( eofID = 0; eofID < n_eig; eofID++ ) */
if ( cdoTimer ) timer_stop(timer_post);
......
......@@ -420,9 +420,6 @@ void scrip_remap_weights_distwgt(int num_neighbors, remapgrid_t *src_grid, remap
long tgt_grid_size;
long n, nadds;
long dst_add; /* destination address */
int nbr_mask[num_neighbors]; /* mask at nearest neighbors */
int nbr_add[num_neighbors]; /* source address at nearest neighbors */
double nbr_dist[num_neighbors]; /* angular distance four nearest neighbors */
double dist_tot; /* sum of neighbor distances (for normalizing) */
double *coslat, *sinlat; /* cosine, sine of grid lats (for distance) */
double *coslon, *sinlon; /* cosine, sine of grid lons (for distance) */
......@@ -494,11 +491,14 @@ void scrip_remap_weights_distwgt(int num_neighbors, remapgrid_t *src_grid, remap
#if defined(_OPENMP)
#pragma omp parallel for default(none) \
shared(ompNumThreads, cdoTimer, num_neighbors, remap_grid_type, src_grid, tgt_grid, rv, tgt_grid_size, coslat, coslon, sinlat, sinlon, findex) \
private(dst_add, n, nadds, dist_tot, nbr_add, nbr_dist, nbr_mask, plat, plon) \
private(dst_add, n, nadds, dist_tot, plat, plon) \
schedule(dynamic,1)
#endif
for ( dst_add = 0; dst_add < tgt_grid_size; ++dst_add )
{
int nbr_mask[num_neighbors]; /* mask at nearest neighbors */
int nbr_add[num_neighbors]; /* source address at nearest neighbors */
double nbr_dist[num_neighbors]; /* angular distance four nearest neighbors */
int lprogress = 1;
if ( cdo_omp_get_thread_num() != 0 ) lprogress = 0;
......
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