Commit 37ac0fd7 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

EOF cleanup.

parent f9101acb
......@@ -239,8 +239,6 @@ void *EOFs(void * argument)
/* eigenvalues */
int tsID = 0;
/* COUNT NUMBER OF TIMESTEPS if EOF_ or EOF_TIME */
if ( operfunc == EOF_ || operfunc == EOF_TIME )
{
......@@ -249,14 +247,9 @@ void *EOFs(void * argument)
nts = vlistNtsteps(vlistID1);
if ( nts == -1 )
{
while ( TRUE )
{
nrecs = streamInqTimestep(streamID1, tsID);
if ( nrecs == 0 ) break;
tsID++;
}
nts = 0;
while ( streamInqTimestep(streamID1, nts) ) nts++;
nts = tsID;
if ( cdoVerbose ) cdoPrint("Counted %i timeSteps", nts);
}
else
......@@ -352,7 +345,7 @@ void *EOFs(void * argument)
double **covar = NULL;
double sum_w = 1.;
tsID = 0;
int tsID = 0;
/* read the data and create covariance matrices for each var & level */
while ( TRUE )
......@@ -455,7 +448,7 @@ void *EOFs(void * argument)
taxisDefRtime(taxisID2, 0);
vlistDefTaxis(vlistID2, taxisID2);
int gridID2 = gridCreate(GRID_LONLAT, 1);
int gridID2 = gridCreate(GRID_LONLAT, 1);
gridDefXsize(gridID2, 1);
gridDefYsize(gridID2, 1);
double xvals = 0, yvals = 0;
......
......@@ -110,20 +110,13 @@ void *EOF3d(void * argument)
if ( operfunc == EOF3D_SPATIAL )
cdoAbort("Operator not Implemented - use eof3d or eof3dtime instead");
int tsID = 0;
/* COUNT NUMBER OF TIMESTEPS if EOF3D_ or EOF3D_TIME */
int nts = vlistNtsteps(vlistID1);
if ( nts == -1 )
{
while ( TRUE )
{
nrecs = streamInqTimestep(streamID1, tsID);
if ( nrecs == 0 ) break;
tsID++;
}
nts = tsID;
nts = 0;
while ( streamInqTimestep(streamID1, nts) ) nts++;
if ( cdoVerbose ) cdoPrint("Counted %i timeSteps", nts);
}
else
......@@ -165,7 +158,7 @@ void *EOF3d(void * argument)
datacounts[varID] = (int*) Malloc(nlevs*sizeof(int));
datafields[varID] = (double **) Malloc(nts*sizeof(double *));
for ( tsID = 0; tsID < nts; tsID++ )
for ( int tsID = 0; tsID < nts; tsID++ )
{
datafields[varID][tsID] = (double *) Malloc(temp_size*sizeof(double));
for ( size_t i = 0; i < temp_size; ++i ) datafields[varID][tsID][i] = 0;
......@@ -194,7 +187,7 @@ void *EOF3d(void * argument)
cdoPrint("allocated eigenvalue/eigenvector with nts=%i, n=%i, gridsize=%i for processing in %s",
nts,n,gridsize,"time_space");
tsID = 0;
int tsID = 0;
/* read the data and create covariance matrices for each var & level */
while ( TRUE )
......
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