Commit 8acd16cd authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

merge: search for first time variing stream

parent 67957692
......@@ -3,6 +3,10 @@
* using CDI library version 1.7.0
* Version 1.7.0 released
2015-09-15 Uwe Schulzweida
* merge: search for first time variing stream
2015-09-06 Uwe Schulzweida
* Select: set default time of enddate to 23:59:59
......
......@@ -26,6 +26,7 @@ Version 1.7.0 (28 October 2015):
* env. CDO_TIMESTAT_DATE does not work [Bug #5758]
* splityear*: support for constant fields is missing [Bug #5759]
* yseaspctl: check of verification date failed [Bug #5810]
* Converting rotated lat-lon netcdf to/from grib: flip sign of the angle of rotation [Bug #5870]
Version 1.6.9 (28 April 2015):
......
......@@ -182,8 +182,21 @@ void *Merge(void *argument)
vlistIDs[index] = streamInqVlist(streamID1);
}
int taxisindex = 0;
int vlistID1 = vlistIDs[0];
int taxisID1 = vlistInqTaxis(vlistID1);
if ( vlistNtsteps(vlistID1) == 0 )
for ( index = 1; index < nmerge; index++ )
{
vlistID1 = vlistIDs[index];
if ( vlistNtsteps(vlistID1) != 0 )
{
taxisindex = index;
taxisID1 = vlistInqTaxis(vlistID1);
break;
}
}
int taxisID2 = taxisDuplicate(taxisID1);
int vlistID2 = vlistCreate();
......@@ -239,7 +252,6 @@ void *Merge(void *argument)
array = (double*) Malloc(gridsize*sizeof(double));
}
int firstindex = 0;
int tsID = 0;
while ( tsID >= 0 )
{
......@@ -272,11 +284,11 @@ void *Merge(void *argument)
for ( index = 0; index < nmerge; index++ )
printf("tsID %d %d sID %d vID %d nrecs %d\n", tsID, index, streamIDs[index], vlistIDs[index], numrecs[index]);
*/
if ( numrecs[firstindex] == 0 )
if ( numrecs[taxisindex] == 0 )
{
for ( index = 1; index < nmerge; index++ )
if ( vlistIDs[index] != -1 && numrecs[index] != 0 )
cdoWarning("Input stream %d has %d timestep%s. Stream %d has more timesteps, skipped!", firstindex+1, tsID, tsID==1?"":"s", index+1);
cdoWarning("Input stream %d has %d timestep%s. Stream %d has more timesteps, skipped!", taxisindex+1, tsID, tsID==1?"":"s", index+1);
break;
}
else
......@@ -284,12 +296,15 @@ void *Merge(void *argument)
for ( index = 1; index < nmerge; index++ )
if ( vlistIDs[index] != -1 && numrecs[index] == 0 )
{
cdoWarning("Input stream %d has %d timestep%s. Stream %d has more timesteps, skipped!", index+1, tsID, tsID==1?"":"s", firstindex+1);
cdoWarning("Input stream %d has %d timestep%s. Stream %d has more timesteps, skipped!", index+1, tsID, tsID==1?"":"s", taxisindex+1);
break;
}
if ( index < nmerge ) break;
}
taxisCopyTimestep(taxisID2, taxisID1);
streamDefTimestep(streamID2, tsID);
for ( index = 0; index < nmerge; index++ )
{
streamID1 = streamIDs[index];
......@@ -298,12 +313,6 @@ void *Merge(void *argument)
if ( vlistID1 == -1 ) continue;
if ( index == firstindex )
{
taxisCopyTimestep(taxisID2, taxisID1);
streamDefTimestep(streamID2, tsID);
}
for ( recID = 0; recID < nrecs; recID++ )
{
streamInqRecord(streamID1, &varID, &levelID);
......
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