Commit 4f9abdb6 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Tee: removed lcopy branch.

parent a3c58cbe
......@@ -28,25 +28,20 @@ Tee(void *process)
cdoInitialize(process);
bool lcopy = UNCHANGED_RECORD;
const int streamID1 = cdoStreamOpenRead(cdoStreamName(0));
int streamID1 = cdoStreamOpenRead(cdoStreamName(0));
const int vlistID1 = cdoStreamInqVlist(streamID1);
const int taxisID1 = vlistInqTaxis(vlistID1);
int vlistID1 = cdoStreamInqVlist(streamID1);
int taxisID1 = vlistInqTaxis(vlistID1);
const int streamID2 = cdoStreamOpenWrite(cdoStreamName(1));
if (1 != operatorArgc()) cdoAbort("Operator tee requires exactly 1 argument.");
const int streamID3 = streamOpenWrite(operatorArgv()[0], cdoFiletype());
int streamID2 = cdoStreamOpenWrite(cdoStreamName(1));
if (1 != operatorArgc())
{
cdoAbort("Operator tee requires exactly 1 argument.");
}
int streamID3 = streamOpenWrite(operatorArgv()[0],cdoFiletype());
const int vlistID2 = vlistDuplicate(vlistID1);
const int vlistID3 = vlistDuplicate(vlistID1);
int vlistID2 = vlistDuplicate(vlistID1);
int vlistID3 = vlistDuplicate(vlistID1);
int taxisID2 = taxisDuplicate(taxisID1);
int taxisID3 = taxisDuplicate(taxisID1);
const int taxisID2 = taxisDuplicate(taxisID1);
const int taxisID3 = taxisDuplicate(taxisID1);
vlistDefTaxis(vlistID2, taxisID2);
vlistDefTaxis(vlistID3, taxisID3);
......@@ -54,7 +49,7 @@ Tee(void *process)
cdoDefVlist(streamID2, vlistID2);
streamDefVlist(streamID3, vlistID3);
size_t gridsizemax = vlistGridsizeMax(vlistID1);
const size_t gridsizemax = vlistGridsizeMax(vlistID1);
std::vector<double> array(gridsizemax);
int tsID = 0;
......@@ -68,27 +63,14 @@ Tee(void *process)
for (int recID = 0; recID < nrecs; recID++)
{
if (lcopy)
{
cdoInqRecord(streamID1, &varID, &levelID);
cdoDefRecord(streamID2, varID, levelID);
cdoCopyRecord(streamID2, streamID1);
streamDefRecord(streamID3, varID, levelID);
streamCopyRecord(streamID3, streamID1);
}
else
{
cdoInqRecord(streamID1, &varID, &levelID);
cdoReadRecord(streamID1, array.data(), &nmiss);
cdoDefRecord(streamID2, varID, levelID);
cdoWriteRecord(streamID2, array.data(), nmiss);
streamDefRecord(streamID3, varID, levelID);
streamWriteRecord(streamID3, array.data(), nmiss);
}
cdoInqRecord(streamID1, &varID, &levelID);
cdoReadRecord(streamID1, array.data(), &nmiss);
cdoDefRecord(streamID2, varID, levelID);
cdoWriteRecord(streamID2, array.data(), nmiss);
streamDefRecord(streamID3, varID, levelID);
streamWriteRecord(streamID3, array.data(), nmiss);
}
tsID++;
......
Markdown is supported
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