Commit c941b498 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

seldate: open output file only when time steps found (bug fix)

parent 3f2ebc0b
2010-07-13 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* seldate: open output file only when time steps found (bug fix) [report: Hannes Reuter]
2010-07-12 Cedrick Ansorge <Cedrick.Ansorge@zmaw.de>
* Added module Filter - Time series filtering
......
......@@ -7,6 +7,8 @@ Version 1.4.6 (?? September 2010):
* bandpass: Bandpass filtering
* lowpass: Lowpass filtering
* highpass: Highpass filtering
Fixed bugs:
* seldate: open output file only when time steps found
Version 1.4.5.1 (05 July 2010):
......
......@@ -50,7 +50,7 @@ void *Seltime(void *argument)
int operatorID;
int operfunc, intval;
int moddat[NOPERATORS];
int streamID1, streamID2;
int streamID1, streamID2 = -1;
int tsID, tsID2, nrecs;
int recID, varID, levelID;
int *intarr, nsel = 0, selival;
......@@ -303,11 +303,6 @@ void *Seltime(void *argument)
taxisID2 = taxisDuplicate(taxisID1);
vlistDefTaxis(vlistID2, taxisID2);
streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
if ( streamID2 < 0 ) cdiError(streamID2, "Open failed on %s", cdoStreamName(1));
streamDefVlist(streamID2, vlistID2);
if ( ! lcopy )
{
gridsize = vlistGridsizeMax(vlistID1);
......@@ -434,6 +429,14 @@ void *Seltime(void *argument)
if ( copytimestep || copy_nts2 )
{
if ( tsID2 == 0 )
{
streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
if ( streamID2 < 0 ) cdiError(streamID2, "Open failed on %s", cdoStreamName(1));
streamDefVlist(streamID2, vlistID2);
}
if ( lnts1 && ncts == 0 )
{
nts = nts1;
......@@ -568,7 +571,7 @@ void *Seltime(void *argument)
tsID++;
}
streamClose(streamID2);
if ( streamID2 != -1 ) streamClose(streamID2);
streamClose(streamID1);
if ( operatorID == SELSMON )
......
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