Skip to content
Snippets Groups Projects
Commit 076aa76f authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

eof: removed scaling with grid cell area weights (bug fix)

parent b57af643
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,11 @@
* Version 1.6.8 released
2015-03-11 Uwe Schulzweida
* eofspatial: removed scaling with grid cell area weights (bug fix)
* eoftime: removed scaling with grid cell area weights (bug fix)
2015-03-10 Uwe Schulzweida
* ensSTAT: added optional parameter count to count the number of valid values
......
......@@ -512,10 +512,15 @@ void *EOFs(void * argument)
else
{
j = pack[jpack];
#ifdef OLD_IMPLEMENTATION
covar[ipack][jpack] =
covar[ipack][jpack] * // covariance
sqrt(weight[i]) * sqrt(weight[j]) / sum_w / // weights
nts; // number of data contributing
#else
covar[ipack][jpack] =
covar[ipack][jpack] / nts; // number of data contributing
#endif
}
}
}
......@@ -545,11 +550,15 @@ void *EOFs(void * argument)
sum = 0;
double *df1p = data[j1];
double *df2p = data[j2];
#ifdef OLD_IMPLEMENTATION
for ( i = 0; i < npack; i++ )
{
sum += weight[pack[i]]*df1p[i]*df2p[i];
}
sum += weight[pack[i]]*df1p[i]*df2p[i];
covar[j1][j2] = sum / sum_w / nts;
#else
for ( i = 0; i < npack; i++ )
sum += df1p[i]*df2p[i];
covar[j1][j2] = sum / nts;
#endif
}
}
......
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