Commit 25af4394 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

pstreamClose: release mem of argument in pipes

parent 77e83f01
......@@ -4,7 +4,7 @@
Name: cdo
#BuildRequires:
Version: 1.6.0
Version: 1.6.1rc3
Release: 1
Summary: Climate Data Operators
License: GNU GENERAL PUBLIC LICENSE Version 2, June 1991
......
......@@ -400,6 +400,7 @@ outputts -outputts \
outputvector -outputvector \
outputvrml -outputvrml \
outputxyz -outputxyz \
pack -pack \
pardes -pardes \
pardup -pardup \
parmul -parmul \
......
......@@ -400,6 +400,7 @@ outputts \
outputvector \
outputvrml \
outputxyz \
pack \
pardes \
pardup \
parmul \
......
......@@ -400,6 +400,7 @@ outputts -outputts \
outputvector -outputvector \
outputvrml -outputvrml \
outputxyz -outputxyz \
pack -pack \
pardes -pardes \
pardup -pardup \
parmul -parmul \
......
......@@ -113,12 +113,12 @@ void *Arith(void *argument)
if ( ntsteps1 != 1 && ntsteps2 == 1 )
{
filltype = FILL_VAR;
cdoPrint("Filling up stream2 >%s< by copying the first variable.", cdoStreamName(1));
cdoPrint("Filling up stream2 >%s< by copying the first variable.", cdoStreamName(1)->args);
}
else
{
filltype = FILL_VARTS;
cdoPrint("Filling up stream2 >%s< by copying the first variable of each timestep.", cdoStreamName(1));
cdoPrint("Filling up stream2 >%s< by copying the first variable of each timestep.", cdoStreamName(1)->args);
}
}
else if ( lfill1 )
......@@ -128,12 +128,12 @@ void *Arith(void *argument)
if ( ntsteps1 == 1 && ntsteps2 != 1 )
{
filltype = FILL_VAR;
cdoPrint("Filling up stream1 >%s< by copying the first variable.", cdoStreamName(0));
cdoPrint("Filling up stream1 >%s< by copying the first variable.", cdoStreamName(0)->args);
}
else
{
filltype = FILL_VARTS;
cdoPrint("Filling up stream1 >%s< by copying the first variable of each timestep.", cdoStreamName(0));
cdoPrint("Filling up stream1 >%s< by copying the first variable of each timestep.", cdoStreamName(0)->args);
}
streamIDx1 = streamID2;
streamIDx2 = streamID1;
......@@ -163,12 +163,12 @@ void *Arith(void *argument)
if ( ntsteps1 != 1 && ntsteps2 == 1 )
{
filltype = FILL_TS;
cdoPrint("Filling up stream2 >%s< by copying the first timestep.", cdoStreamName(1));
cdoPrint("Filling up stream2 >%s< by copying the first timestep.", cdoStreamName(1)->args);
}
else if ( ntsteps1 == 1 && ntsteps2 != 1 )
{
filltype = FILL_TS;
cdoPrint("Filling up stream1 >%s< by copying the first timestep.", cdoStreamName(0));
cdoPrint("Filling up stream1 >%s< by copying the first timestep.", cdoStreamName(0)->args);
streamIDx1 = streamID2;
streamIDx2 = streamID1;
vlistIDx1 = vlistID2;
......@@ -220,7 +220,7 @@ void *Arith(void *argument)
if ( filltype == FILL_NONE && streamIDx2 == streamID2 )
{
filltype = FILL_FILE;
cdoPrint("Filling up stream2 >%s< by copying all timesteps.", cdoStreamName(1));
cdoPrint("Filling up stream2 >%s< by copying all timesteps.", cdoStreamName(1)->args);
}
if ( filltype == FILL_FILE )
......@@ -237,7 +237,7 @@ void *Arith(void *argument)
nrecs2 = streamInqTimestep(streamIDx2, tsID2);
if ( nrecs2 == 0 )
cdoAbort("Empty input stream %s!", cdoStreamName(1));
cdoAbort("Empty input stream %s!", cdoStreamName(1)->args);
}
else
cdoAbort("Input streams have different number of timesteps!");
......
......@@ -205,7 +205,7 @@ void *CDIread(void *argument)
tw = timer_val(timer_read) - tw0;
twsum += tw;
file_size = (double) filesize(cdoStreamName(0));
file_size = (double) filesize(cdoStreamName(0)->args);
if ( nruns > 1 ) sprintf(sinfo, "(run %d)", irun+1);
......
......@@ -279,7 +279,7 @@ void *CDIwrite(void *argument)
tw = timer_val(timer_write) - tw0;
twsum += tw;
file_size = (double ) filesize(cdoStreamName(0));
file_size = (double ) filesize(cdoStreamName(0)->args);
if ( nruns > 1 ) sprintf(sinfo, "(run %d)", irun+1);
......
......@@ -51,7 +51,7 @@ void *Cat(void *argument)
for ( indf = 0; indf < nfiles; indf++ )
{
if ( cdoVerbose ) cdoPrint("Process file: %s", cdoStreamName(indf));
if ( cdoVerbose ) cdoPrint("Process file: %s", cdoStreamName(indf)->args);
streamID1 = streamOpenRead(cdoStreamName(indf));
......@@ -60,7 +60,7 @@ void *Cat(void *argument)
if ( indf == 0 )
{
if ( fileExists(cdoStreamName(nfiles)) )
if ( fileExists(cdoStreamName(nfiles)->args) )
{
streamID2 = streamOpenAppend(cdoStreamName(nfiles));
......@@ -75,7 +75,7 @@ void *Cat(void *argument)
else
{
if ( cdoVerbose )
cdoPrint("Output file doesn't exist, creating: %s", cdoStreamName(nfiles));
cdoPrint("Output file doesn't exist, creating: %s", cdoStreamName(nfiles)->args);
streamID2 = streamOpenWrite(cdoStreamName(nfiles), cdoFiletype());
......
......@@ -91,12 +91,12 @@ void *Comp(void *argument)
if ( vlistNrecs(vlistID1) != 1 && vlistNrecs(vlistID2) == 1 )
{
filltype = FILL_REC;
cdoPrint("Filling up stream2 >%s< by copying the first record.", cdoStreamName(1));
cdoPrint("Filling up stream2 >%s< by copying the first record.", cdoStreamName(1)->args);
}
else if ( vlistNrecs(vlistID1) == 1 && vlistNrecs(vlistID2) != 1 )
{
filltype = FILL_REC;
cdoPrint("Filling up stream1 >%s< by copying the first record.", cdoStreamName(0));
cdoPrint("Filling up stream1 >%s< by copying the first record.", cdoStreamName(0)->args);
streamIDx1 = streamID2;
streamIDx2 = streamID1;
vlistIDx1 = vlistID2;
......@@ -127,12 +127,12 @@ void *Comp(void *argument)
if ( ntsteps1 != 1 && ntsteps2 == 1 )
{
filltype = FILL_TS;
cdoPrint("Filling up stream2 >%s< by copying the first timestep.", cdoStreamName(1));
cdoPrint("Filling up stream2 >%s< by copying the first timestep.", cdoStreamName(1)->args);
}
else if ( ntsteps1 == 1 && ntsteps2 != 1 )
{
filltype = FILL_TS;
cdoPrint("Filling up stream1 >%s< by copying the first timestep.", cdoStreamName(0));
cdoPrint("Filling up stream1 >%s< by copying the first timestep.", cdoStreamName(0)->args);
streamIDx1 = streamID2;
streamIDx2 = streamID1;
vlistIDx1 = vlistID2;
......
......@@ -77,7 +77,7 @@ void *Cond(void *argument)
if ( vlistNrecs(vlistID1) == 1 && vlistNrecs(vlistID2) != 1 )
{
filltype = FILL_REC;
cdoPrint("Filling up stream1 >%s< by copying the first record.", cdoStreamName(0));
cdoPrint("Filling up stream1 >%s< by copying the first record.", cdoStreamName(0)->args);
}
if ( filltype == FILL_NONE )
......@@ -93,7 +93,7 @@ void *Cond(void *argument)
gridsize = vlistGridsizeMax(vlistID2);
if ( filltype == FILL_REC && gridsize != gridInqSize(vlistGrid(vlistID1, 0)) )
cdoAbort("Stream1 >%s< has wrong gridsize!", cdoStreamName(0));
cdoAbort("Stream1 >%s< has wrong gridsize!", cdoStreamName(0)->args);
array1 = (double *) malloc(gridsize*sizeof(double));
array2 = (double *) malloc(gridsize*sizeof(double));
......@@ -107,7 +107,7 @@ void *Cond(void *argument)
if ( ntsteps1 == 1 && ntsteps2 != 1 )
{
filltype = FILL_TS;
cdoPrint("Filling up stream1 >%s< by copying the first timestep.", cdoStreamName(0));
cdoPrint("Filling up stream1 >%s< by copying the first timestep.", cdoStreamName(0)->args);
nvars = vlistNvars(vlistID1);
vardata1 = (double **) malloc(nvars*sizeof(double *));
......
......@@ -77,7 +77,7 @@ void *Cond2(void *argument)
if ( vlistNrecs(vlistID1) == 1 && vlistNrecs(vlistID2) != 1 )
{
filltype = FILL_REC;
cdoPrint("Filling up stream1 >%s< by copying the first record.", cdoStreamName(0));
cdoPrint("Filling up stream1 >%s< by copying the first record.", cdoStreamName(0)->args);
}
if ( filltype == FILL_NONE )
......@@ -96,7 +96,7 @@ void *Cond2(void *argument)
gridsize = vlistGridsizeMax(vlistID1);
if ( filltype == FILL_REC && gridsize != gridInqSize(vlistGrid(vlistID1, 0)) )
cdoAbort("Stream1 >%s< has wrong gridsize!", cdoStreamName(0));
cdoAbort("Stream1 >%s< has wrong gridsize!", cdoStreamName(0)->args);
array1 = (double *) malloc(gridsize*sizeof(double));
array2 = (double *) malloc(gridsize*sizeof(double));
......@@ -112,7 +112,7 @@ void *Cond2(void *argument)
if ( ntsteps1 == 1 && ntsteps2 != 1 )
{
filltype = FILL_TS;
cdoPrint("Filling up stream1 >%s< by copying the first timestep.", cdoStreamName(0));
cdoPrint("Filling up stream1 >%s< by copying the first timestep.", cdoStreamName(0)->args);
nvars = vlistNvars(vlistID1);
vardata1 = (double **) malloc(nvars*sizeof(double *));
......
......@@ -67,7 +67,7 @@ void *Copy(void *argument)
tsID2 = 0;
for ( indf = 0; indf < nfiles; indf++ )
{
if ( cdoVerbose ) cdoPrint("Process file: %s", cdoStreamName(indf));
if ( cdoVerbose ) cdoPrint("Process file: %s", cdoStreamName(indf)->args);
streamID1 = streamOpenRead(cdoStreamName(indf));
......
......@@ -1456,9 +1456,9 @@ void *Echam5ini(void *argument)
iniatts(&atts);
if ( operatorID == IMPORT_E5ML )
nvars = import_e5ml(cdoStreamName(0), &vars);
nvars = import_e5ml(cdoStreamName(0)->args, &vars);
else if ( operatorID == IMPORT_E5RES )
nvars = import_e5res(cdoStreamName(0), &vars, &atts);
nvars = import_e5res(cdoStreamName(0)->args, &vars, &atts);
else
cdoAbort("Operator not implemented!");
......@@ -1607,9 +1607,9 @@ void *Echam5ini(void *argument)
streamClose(streamID1);
if ( operatorID == EXPORT_E5ML )
export_e5ml(cdoStreamName(1), vars, nvars, vdate, vtime, ntr);
export_e5ml(cdoStreamName(1)->args, vars, nvars, vdate, vtime, ntr);
else if ( operatorID == EXPORT_E5RES )
export_e5res(cdoStreamName(1), vars, nvars);
export_e5res(cdoStreamName(1)->args, vars, nvars);
else
cdoAbort("Operator not implemented!");
}
......
......@@ -202,7 +202,7 @@ void *Enlargegrid(void *argument)
if ( vlistGrid(vlistID1, 0) != vlistGrid(vlistID1, index) )
ndiffgrids++;
if ( ndiffgrids > 0 ) cdoAbort("Too many different grids in %s!", cdoStreamName(0));
if ( ndiffgrids > 0 ) cdoAbort("Too many different grids in %s!", cdoStreamName(0)->args);
gridID1 = vlistGrid(vlistID1, 0);
......
......@@ -101,7 +101,7 @@ void *Ensstat(void *argument)
if ( cdoVerbose )
cdoPrint("Ensemble over %d files.", nfiles);
ofilename = cdoStreamName(nfiles);
ofilename = cdoStreamName(nfiles)->args;
if ( !cdoSilentMode && !cdoOverwriteMode )
if ( fileExists(ofilename) )
......@@ -162,10 +162,10 @@ void *Ensstat(void *argument)
if ( nrecs != nrecs0 )
{
if ( nrecs == 0 )
cdoAbort("Inconsistent ensemble file, too few time steps in %s!", cdoStreamName(fileID));
cdoAbort("Inconsistent ensemble file, too few time steps in %s!", cdoStreamName(fileID)->args);
else
cdoAbort("Inconsistent ensemble file, number of records at time step %d of %s and %s differ!",
tsID+1, cdoStreamName(0), cdoStreamName(fileID));
tsID+1, cdoStreamName(0)->args, cdoStreamName(fileID)->args);
}
}
......
......@@ -114,7 +114,7 @@ void *Ensstat3(void *argument)
if ( cdoVerbose )
cdoPrint("Ensemble over %d files.", nfiles);
ofilename = cdoStreamName(nfiles);
ofilename = cdoStreamName(nfiles)->args;
if ( !cdoSilentMode && !cdoOverwriteMode )
if ( fileExists(ofilename) )
......@@ -260,10 +260,10 @@ void *Ensstat3(void *argument)
if ( nrecs != nrecs0 )
{
if ( nrecs == 0 )
cdoAbort("Inconsistent ensemble file, too few time steps in %s!", cdoStreamName(fileID));
cdoAbort("Inconsistent ensemble file, too few time steps in %s!", cdoStreamName(fileID)->args);
else
cdoAbort("Inconsistent ensemble file, number of records at time step %d of %s and %s differ!",
tsID+1, cdoStreamName(0), cdoStreamName(fileID));
tsID+1, cdoStreamName(0)->args, cdoStreamName(fileID)->args);
}
}
......
......@@ -175,7 +175,7 @@ void *Ensval(void *argument)
gridDefXvals(gridID2, &xval);
gridDefYvals(gridID2, &yval);
ofilebase = cdoStreamName(nfiles);
ofilebase = cdoStreamName(nfiles)->args;
memset(file_suffix, 0, sizeof(file_suffix) );
cdoGenFileSuffix(&file_suffix[0], sizeof(file_suffix),
......@@ -245,7 +245,7 @@ void *Ensval(void *argument)
streamID = ef[fileID].streamID;
nrecs = streamInqTimestep(streamID, tsID);
if ( nrecs != nrecs0 )
cdoAbort("Number of records at time step %d of %s and %s differ!", tsID+1, cdoStreamName(0), cdoStreamName(fileID));
cdoAbort("Number of records at time step %d of %s and %s differ!", tsID+1, cdoStreamName(0)->args, cdoStreamName(fileID)->args);
}
for ( stream = 0; stream < nostreams; stream++ ) {
......
......@@ -90,10 +90,10 @@ void *Eofcoeff(void * argument)
if (vlistGridsizeMax(vlistID2) != gridsize ||
vlistInqVarGrid(vlistID2, 0) != gridID1 )
cdoAbort("EOFs (%s) and data (%s) defined on different grids", cdoStreamName(0), cdoStreamName(1));
cdoAbort("EOFs (%s) and data (%s) defined on different grids", cdoStreamName(0)->args, cdoStreamName(1)->args);
strcpy(oname, cdoStreamName(2));
strcpy(oname, cdoStreamName(2)->args);
nchars = strlen(oname);
filesuffix[0] = 0;
......@@ -137,7 +137,7 @@ void *Eofcoeff(void * argument)
}
neof = eofID;
if ( cdoVerbose ) cdoPrint("%s contains %i eof's", cdoStreamName(0), neof);
if ( cdoVerbose ) cdoPrint("%s contains %i eof's", cdoStreamName(0)->args, neof);
// Create 1x1 Grid for output
gridID3 = gridCreate(GRID_LONLAT, 1);
gridDefXsize(gridID3, 1);
......
......@@ -89,9 +89,9 @@ void *Eofcoeff3d(void * argument)
if (vlistGridsizeMax(vlistID2) != gridsize ||
vlistInqVarGrid(vlistID2, 0) != gridID1 )
cdoAbort("EOFs (%s) and data (%s) defined on different grids", cdoStreamName(0), cdoStreamName(1));
cdoAbort("EOFs (%s) and data (%s) defined on different grids", cdoStreamName(0)->args, cdoStreamName(1)->args);
strcpy(oname, cdoStreamName(2));
strcpy(oname, cdoStreamName(2)->args);
nchars = strlen(oname);
filesuffix[0] = 0;
......@@ -136,7 +136,7 @@ void *Eofcoeff3d(void * argument)
}
neof = eofID;
if ( cdoVerbose ) cdoPrint("%s contains %i eof's", cdoStreamName(0), neof);
if ( cdoVerbose ) cdoPrint("%s contains %i eof's", cdoStreamName(0)->args, neof);
// Create 1x1 Grid for output
gridID3 = gridCreate(GRID_LONLAT, 1);
gridDefXsize(gridID3, 1);
......
......@@ -290,7 +290,7 @@ void *Gather(void *argument)
nfiles = cdoStreamCnt() - 1;
ofilename = cdoStreamName(nfiles);
ofilename = cdoStreamName(nfiles)->args;
if ( !cdoSilentMode && !cdoOverwriteMode )
if ( fileExists(ofilename) )
......@@ -398,7 +398,7 @@ void *Gather(void *argument)
streamID = ef[fileID].streamID;
nrecs = streamInqTimestep(streamID, tsID);
if ( nrecs != nrecs0 )
cdoAbort("Number of records at time step %d of %s and %s differ!", tsID+1, cdoStreamName(0), cdoStreamName(fileID));
cdoAbort("Number of records at time step %d of %s and %s differ!", tsID+1, cdoStreamName(0)->args, cdoStreamName(fileID)->args);
}
taxisCopyTimestep(taxisID2, taxisID1);
......
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