Skip to content

Commit 4691d2a

Browse files
committed
sorted variables to private/shared
1 parent ba4d5c8 commit 4691d2a

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/lower-level/resmerge-ll.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,16 @@ short **toa_ = NULL;
120120
if ((bands[b++] = find_domain(TOA, "SWIR1")) < 0) return FAILURE;
121121
if ((bands[b++] = find_domain(TOA, "SWIR2")) < 0) return FAILURE;
122122

123-
#pragma omp parallel private() shared() default(none)
123+
// kernel size
124+
w = r*2+1; nw = w*w;
125+
126+
127+
#pragma omp parallel private(k,b,j,p,ii,jj,ni,nj,np,X,x,y,c,cov,work,chisq,est,err) shared(r,w,nb,nw,nv,ny,nx,QAI,toa_,bands,green,red,bnir) default(none)
124128
{
125129

126130
/** initialize and allocate
127131
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++**/
128132

129-
// kernel size
130-
w = r*2+1; nw = w*w;
131-
132133
// nw-by-nv predictor variables; kernel + central pixel
133134
X = gsl_matrix_calloc(nw, nv);
134135
x = gsl_vector_calloc(nv);
@@ -158,8 +159,10 @@ short **toa_ = NULL;
158159
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++**/
159160

160161
#pragma omp for schedule(guided)
161-
for (i=0, p=0; i<ny; i++){
162-
for (j=0; j<nx; j++, p++){
162+
for (i=0; i<ny; i++){
163+
for (j=0; j<nx; j++){
164+
165+
p = i*nx+j;
163166

164167
if (get_off(QAI, p) || get_cloud(QAI, p) > 0 || get_shadow(QAI, p)) continue;
165168

0 commit comments

Comments
 (0)