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

Renamed streamXXX() to pstreamXXX().

parent 6c400ef5
...@@ -35,11 +35,11 @@ void *Gengrid(void *argument) ...@@ -35,11 +35,11 @@ void *Gengrid(void *argument)
cdoInitialize(argument); cdoInitialize(argument);
int streamID1 = streamOpenRead(cdoStreamName(0)); int streamID1 = pstreamOpenRead(cdoStreamName(0));
int streamID2 = streamOpenRead(cdoStreamName(1)); int streamID2 = pstreamOpenRead(cdoStreamName(1));
int vlistID1 = streamInqVlist(streamID1); int vlistID1 = pstreamInqVlist(streamID1);
int vlistID2 = streamInqVlist(streamID2); int vlistID2 = pstreamInqVlist(streamID2);
int gridID1 = vlistGrid(vlistID1, 0); int gridID1 = vlistGrid(vlistID1, 0);
int gridID2 = vlistGrid(vlistID2, 0); int gridID2 = vlistGrid(vlistID2, 0);
...@@ -55,15 +55,15 @@ void *Gengrid(void *argument) ...@@ -55,15 +55,15 @@ void *Gengrid(void *argument)
double *array2 = (double*) Malloc(gridsize*sizeof(double)); double *array2 = (double*) Malloc(gridsize*sizeof(double));
double *array3 = (double*) Malloc(gridsize*sizeof(double)); double *array3 = (double*) Malloc(gridsize*sizeof(double));
streamInqRecord(streamID1, &varID, &levelID); pstreamInqRecord(streamID1, &varID, &levelID);
streamReadRecord(streamID1, array1, &nmiss1); pstreamReadRecord(streamID1, array1, &nmiss1);
streamInqRecord(streamID2, &varID, &levelID); pstreamInqRecord(streamID2, &varID, &levelID);
streamReadRecord(streamID2, array2, &nmiss2); pstreamReadRecord(streamID2, array2, &nmiss2);
int datatype = vlistInqVarDatatype(vlistID1, 0); int datatype = vlistInqVarDatatype(vlistID1, 0);
streamClose(streamID2); pstreamClose(streamID2);
streamClose(streamID1); pstreamClose(streamID1);
if ( nmiss1 || nmiss2 ) cdoAbort("Missing values unsupported!"); if ( nmiss1 || nmiss2 ) cdoAbort("Missing values unsupported!");
...@@ -126,19 +126,19 @@ void *Gengrid(void *argument) ...@@ -126,19 +126,19 @@ void *Gengrid(void *argument)
vlistDefTaxis(vlistID3, taxisID3); vlistDefTaxis(vlistID3, taxisID3);
int streamID3 = streamOpenWrite(cdoStreamName(2), cdoFiletype()); int streamID3 = pstreamOpenWrite(cdoStreamName(2), cdoFiletype());
streamDefVlist(streamID3, vlistID3); pstreamDefVlist(streamID3, vlistID3);
int tsID = 0; int tsID = 0;
streamDefTimestep(streamID3, tsID); pstreamDefTimestep(streamID3, tsID);
for ( int i = 0; i < gridsize; ++i ) array3[i] = missval; for ( int i = 0; i < gridsize; ++i ) array3[i] = missval;
streamDefRecord(streamID3, 0, 0); pstreamDefRecord(streamID3, 0, 0);
streamWriteRecord(streamID3, array3, gridsize); pstreamWriteRecord(streamID3, array3, gridsize);
streamClose(streamID3); pstreamClose(streamID3);
if ( array1 ) Free(array1); if ( array1 ) Free(array1);
if ( array2 ) Free(array2); if ( array2 ) Free(array2);
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#if defined(HAVE_CONFIG_H) #if defined(HAVE_CONFIG_H)
# include "config.h" /* VERSION */ #include "config.h" /* VERSION */
#endif #endif
#include <cdi.h> #include <cdi.h>
...@@ -946,7 +946,6 @@ void *Gradsdes(void *argument) ...@@ -946,7 +946,6 @@ void *Gradsdes(void *argument)
int varID; int varID;
int levelID; int levelID;
int nrecs; int nrecs;
int vdate, vtime;
char *idxfile = NULL; char *idxfile = NULL;
char varname[CDI_MAX_NAME]; char varname[CDI_MAX_NAME];
bool yrev = false; bool yrev = false;
...@@ -1019,16 +1018,16 @@ void *Gradsdes(void *argument) ...@@ -1019,16 +1018,16 @@ void *Gradsdes(void *argument)
cdoAbort("GrADS GRIB map version %d requires size of off_t to be 8! The size of off_t is %ld.", cdoAbort("GrADS GRIB map version %d requires size of off_t to be 8! The size of off_t is %ld.",
map_version, sizeof(off_t)); map_version, sizeof(off_t));
int streamID = streamOpenRead(cdoStreamName(0)); int streamID = pstreamOpenRead(cdoStreamName(0));
int vlistID = streamInqVlist(streamID); int vlistID = pstreamInqVlist(streamID);
int nvars = vlistNvars(vlistID); int nvars = vlistNvars(vlistID);
int ntsteps = vlistNtsteps(vlistID); int ntsteps = vlistNtsteps(vlistID);
int ngrids = vlistNgrids(vlistID); int ngrids = vlistNgrids(vlistID);
int filetype = streamInqFiletype(streamID); int filetype = pstreamInqFiletype(streamID);
int byteorder = streamInqByteorder(streamID); int byteorder = pstreamInqByteorder(streamID);
if ( filetype == CDI_FILETYPE_NC2 || filetype == CDI_FILETYPE_NC4 ) filetype = CDI_FILETYPE_NC; if ( filetype == CDI_FILETYPE_NC2 || filetype == CDI_FILETYPE_NC4 ) filetype = CDI_FILETYPE_NC;
...@@ -1202,10 +1201,10 @@ void *Gradsdes(void *argument) ...@@ -1202,10 +1201,10 @@ void *Gradsdes(void *argument)
bool cal365day = (taxisInqCalendar(taxisID) == CALENDAR_365DAYS); bool cal365day = (taxisInqCalendar(taxisID) == CALENDAR_365DAYS);
int tsID = 0; int tsID = 0;
while ( (nrecs = streamInqTimestep(streamID, tsID)) ) while ( (nrecs = pstreamInqTimestep(streamID, tsID)) )
{ {
vdate = taxisInqVdate(taxisID); int vdate = taxisInqVdate(taxisID);
vtime = taxisInqVtime(taxisID); int vtime = taxisInqVtime(taxisID);
if ( tsID == 0 ) if ( tsID == 0 )
{ {
...@@ -1308,14 +1307,14 @@ void *Gradsdes(void *argument) ...@@ -1308,14 +1307,14 @@ void *Gradsdes(void *argument)
for ( int recID = 0; recID < nrecs; recID++ ) for ( int recID = 0; recID < nrecs; recID++ )
{ {
streamInqRecord(streamID, &varID, &levelID); pstreamInqRecord(streamID, &varID, &levelID);
if ( vars[varID] == TRUE ) if ( vars[varID] == TRUE )
{ {
streamReadRecord(streamID, array, &nmiss); pstreamReadRecord(streamID, array, &nmiss);
index = (tsID*nrecsout + recoffset[varID] + levelID); index = (tsID*nrecsout + recoffset[varID] + levelID);
streamInqGRIBinfo(streamID, &intnum[index], &fltnum[index*3], &bignum[index*2]); pstreamInqGRIBinfo(streamID, &intnum[index], &fltnum[index*3], &bignum[index*2]);
if ( map_version != 4 ) if ( map_version != 4 )
{ {
...@@ -1397,7 +1396,7 @@ void *Gradsdes(void *argument) ...@@ -1397,7 +1396,7 @@ void *Gradsdes(void *argument)
// write_map_grib2(idxfile, map_version, nrecords, intnum, fltnum, bignum); // write_map_grib2(idxfile, map_version, nrecords, intnum, fltnum, bignum);
} }
streamClose(streamID); pstreamClose(streamID);
if ( ctlfile ) Free(ctlfile); if ( ctlfile ) Free(ctlfile);
if ( idxfile ) Free(idxfile); if ( idxfile ) Free(idxfile);
......
...@@ -567,9 +567,9 @@ void *Gridboxstat(void *argument) ...@@ -567,9 +567,9 @@ void *Gridboxstat(void *argument)
int operfunc = cdoOperatorF1(operatorID); int operfunc = cdoOperatorF1(operatorID);
bool needWeights = cdoOperatorF2(operatorID) != 0; bool needWeights = cdoOperatorF2(operatorID) != 0;
int streamID1 = streamOpenRead(cdoStreamName(0)); int streamID1 = pstreamOpenRead(cdoStreamName(0));
int vlistID1 = streamInqVlist(streamID1); int vlistID1 = pstreamInqVlist(streamID1);
int vlistID2 = vlistDuplicate(vlistID1); int vlistID2 = vlistDuplicate(vlistID1);
int taxisID1 = vlistInqTaxis(vlistID1); int taxisID1 = vlistInqTaxis(vlistID1);
...@@ -587,9 +587,8 @@ void *Gridboxstat(void *argument) ...@@ -587,9 +587,8 @@ void *Gridboxstat(void *argument)
for ( int index = 0; index < ngrids; index++ ) for ( int index = 0; index < ngrids; index++ )
vlistChangeGridIndex(vlistID2, index, gridID2); vlistChangeGridIndex(vlistID2, index, gridID2);
int streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype()); int streamID2 = pstreamOpenWrite(cdoStreamName(1), cdoFiletype());
pstreamDefVlist(streamID2, vlistID2);
streamDefVlist(streamID2, vlistID2);
field_type field1, field2; field_type field1, field2;
field_init(&field1); field_init(&field1);
...@@ -604,17 +603,17 @@ void *Gridboxstat(void *argument) ...@@ -604,17 +603,17 @@ void *Gridboxstat(void *argument)
field2.weight = NULL; field2.weight = NULL;
int tsID = 0; int tsID = 0;
while ( (nrecs = streamInqTimestep(streamID1, tsID)) ) while ( (nrecs = pstreamInqTimestep(streamID1, tsID)) )
{ {
taxisCopyTimestep(taxisID2, taxisID1); taxisCopyTimestep(taxisID2, taxisID1);
streamDefTimestep(streamID2, tsID); pstreamDefTimestep(streamID2, tsID);
for ( int recID = 0; recID < nrecs; recID++ ) for ( int recID = 0; recID < nrecs; recID++ )
{ {
int nmiss; int nmiss;
streamInqRecord(streamID1, &varID, &levelID); pstreamInqRecord(streamID1, &varID, &levelID);
streamReadRecord(streamID1, field1.ptr, &nmiss); pstreamReadRecord(streamID1, field1.ptr, &nmiss);
field1.nmiss = (size_t) nmiss; field1.nmiss = (size_t) nmiss;
field1.grid = vlistInqVarGrid(vlistID1, varID); field1.grid = vlistInqVarGrid(vlistID1, varID);
...@@ -638,14 +637,14 @@ void *Gridboxstat(void *argument) ...@@ -638,14 +637,14 @@ void *Gridboxstat(void *argument)
gridboxstat(&field1, &field2, xinc, yinc, operfunc); gridboxstat(&field1, &field2, xinc, yinc, operfunc);
streamDefRecord(streamID2, varID, levelID); pstreamDefRecord(streamID2, varID, levelID);
streamWriteRecord(streamID2, field2.ptr, (int)field2.nmiss); pstreamWriteRecord(streamID2, field2.ptr, (int)field2.nmiss);
} }
tsID++; tsID++;
} }
streamClose(streamID2); pstreamClose(streamID2);
streamClose(streamID1); pstreamClose(streamID1);
if ( field1.ptr ) Free(field1.ptr); if ( field1.ptr ) Free(field1.ptr);
if ( field1.weight ) Free(field1.weight); if ( field1.weight ) Free(field1.weight);
......
...@@ -81,6 +81,7 @@ void grid_cell_area(int gridID, double *array) ...@@ -81,6 +81,7 @@ void grid_cell_area(int gridID, double *array)
} }
} }
void *Gridcell(void *argument) void *Gridcell(void *argument)
{ {
int status; int status;
...@@ -108,9 +109,9 @@ void *Gridcell(void *argument) ...@@ -108,9 +109,9 @@ void *Gridcell(void *argument)
if ( cdoVerbose ) cdoPrint("PlanetRadius: %g", PlanetRadius); if ( cdoVerbose ) cdoPrint("PlanetRadius: %g", PlanetRadius);
int streamID1 = streamOpenRead(cdoStreamName(0)); int streamID1 = pstreamOpenRead(cdoStreamName(0));
int vlistID1 = streamInqVlist(streamID1); int vlistID1 = pstreamInqVlist(streamID1);
int ngrids = vlistNgrids(vlistID1); int ngrids = vlistNgrids(vlistID1);
...@@ -175,8 +176,7 @@ void *Gridcell(void *argument) ...@@ -175,8 +176,7 @@ void *Gridcell(void *argument)
} }
else if ( operatorID == GRIDMASK ) else if ( operatorID == GRIDMASK )
{ {
int *mask; int *mask = (int*) Malloc(gridsize*sizeof(int));
mask = (int*) Malloc(gridsize*sizeof(int));
if ( gridInqMask(gridID, NULL) ) if ( gridInqMask(gridID, NULL) )
{ {
gridInqMask(gridID, mask); gridInqMask(gridID, mask);
...@@ -284,20 +284,20 @@ void *Gridcell(void *argument) ...@@ -284,20 +284,20 @@ void *Gridcell(void *argument)
} }
int streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype()); int streamID2 = pstreamOpenWrite(cdoStreamName(1), cdoFiletype());
streamDefVlist(streamID2, vlistID2); pstreamDefVlist(streamID2, vlistID2);
int tsID = 0; int tsID = 0;
streamDefTimestep(streamID2, tsID); pstreamDefTimestep(streamID2, tsID);
varID = 0; varID = 0;
int levelID = 0; int levelID = 0;
streamDefRecord(streamID2, varID, levelID); pstreamDefRecord(streamID2, varID, levelID);
streamWriteRecord(streamID2, array, 0); pstreamWriteRecord(streamID2, array, 0);
streamClose(streamID2); pstreamClose(streamID2);
streamClose(streamID1); pstreamClose(streamID1);
if ( array ) Free(array); if ( array ) Free(array);
......
#include <cdi.h> #include <cdi.h>
#include "cdo.h" #include "cdo.h"
#include "cdo_int.h" #include "cdo_int.h"
#include "pstream.h"
#include "grid.h" #include "grid.h"
void check_lon_range(long nlons, double *lons); void check_lon_range(long nlons, double *lons);
......
...@@ -56,9 +56,9 @@ void *Harmonic(void *argument) ...@@ -56,9 +56,9 @@ void *Harmonic(void *argument)
cdoAbort("The wave length must be positive and smaller than " cdoAbort("The wave length must be positive and smaller than "
"2 times the number of requested harmonics (=%d)!", n_out); "2 times the number of requested harmonics (=%d)!", n_out);
int streamID1 = streamOpenRead(cdoStreamName(0)); int streamID1 = pstreamOpenRead(cdoStreamName(0));
int vlistID1 = streamInqVlist(streamID1); int vlistID1 = pstreamInqVlist(streamID1);
int vlistID2 = vlistDuplicate(vlistID1); int vlistID2 = vlistDuplicate(vlistID1);
int taxisID1 = vlistInqTaxis(vlistID1); int taxisID1 = vlistInqTaxis(vlistID1);
...@@ -67,7 +67,7 @@ void *Harmonic(void *argument) ...@@ -67,7 +67,7 @@ void *Harmonic(void *argument)
refname = cdoStreamName(0)->argv[cdoStreamName(0)->argc-1]; refname = cdoStreamName(0)->argv[cdoStreamName(0)->argc-1];
filesuffix[0] = 0; filesuffix[0] = 0;
cdoGenFileSuffix(filesuffix, sizeof(filesuffix), streamInqFiletype(streamID1), vlistID1, refname); cdoGenFileSuffix(filesuffix, sizeof(filesuffix), pstreamInqFiletype(streamID1), vlistID1, refname);
int *streamIDs = (int*) Malloc(n_out*sizeof(int)); int *streamIDs = (int*) Malloc(n_out*sizeof(int));
...@@ -81,12 +81,12 @@ void *Harmonic(void *argument) ...@@ -81,12 +81,12 @@ void *Harmonic(void *argument)
sprintf(filename+nchars+1, "%s", filesuffix); sprintf(filename+nchars+1, "%s", filesuffix);
argument_t *fileargument = file_argument_new(filename); argument_t *fileargument = file_argument_new(filename);
int streamID2 = streamOpenWrite(fileargument, cdoFiletype()); int streamID2 = pstreamOpenWrite(fileargument, cdoFiletype());
file_argument_free(fileargument); file_argument_free(fileargument);
streamIDs[j] = streamID2; streamIDs[j] = streamID2;
streamDefVlist(streamID2, vlistID2); pstreamDefVlist(streamID2, vlistID2);
} }
int nvars = vlistNvars(vlistID1); int nvars = vlistNvars(vlistID1);
...@@ -122,7 +122,7 @@ void *Harmonic(void *argument) ...@@ -122,7 +122,7 @@ void *Harmonic(void *argument)
double *array = (double*) Malloc(gridsize*sizeof(double)); double *array = (double*) Malloc(gridsize*sizeof(double));
int tsID = 0; int tsID = 0;
while ( (nrecs = streamInqTimestep(streamID1, tsID)) ) while ( (nrecs = pstreamInqTimestep(streamID1, tsID)) )
{ {
if ( tsID == 0 ) if ( tsID == 0 )
{ {
...@@ -132,18 +132,18 @@ void *Harmonic(void *argument) ...@@ -132,18 +132,18 @@ void *Harmonic(void *argument)
for ( int recID = 0; recID < nrecs; recID++ ) for ( int recID = 0; recID < nrecs; recID++ )
{ {
streamInqRecord(streamID1, &varID, &levelID); pstreamInqRecord(streamID1, &varID, &levelID);
gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID)); pstreamReadRecord(streamID1, array, &nmiss);
offset = gridsize*levelID;
streamReadRecord(streamID1, array, &nmiss);
if ( nmiss > 0 ) cdoAbort("Missing values are not allowed!"); if ( nmiss > 0 ) cdoAbort("Missing values are not allowed!");
gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
offset = gridsize*levelID;
for ( int j = 0; j < n_out; ++j ) for ( int j = 0; j < n_out; ++j )
{ {
double sine = sin (2 * M_PI * (((j + 1) * (tsID+1)) % n) / n); double sine = sin(2 * M_PI * (((j + 1) * (tsID+1)) % n) / n);
double cosine = cos (2 * M_PI * (((j + 1) * (tsID+1)) % n) / n); double cosine = cos(2 * M_PI * (((j + 1) * (tsID+1)) % n) / n);
for ( int i = 0; i < gridsize; i++ ) for ( int i = 0; i < gridsize; i++ )
{ {
work[j][varID][i+offset] += array[i] * sine; work[j][varID][i+offset] += array[i] * sine;
...@@ -159,8 +159,7 @@ void *Harmonic(void *argument) ...@@ -159,8 +159,7 @@ void *Harmonic(void *argument)
if ( array ) Free(array); if ( array ) Free(array);
streamClose(streamID1); pstreamClose(streamID1);
if ( nts%n ) if ( nts%n )
{ {
...@@ -206,7 +205,7 @@ void *Harmonic(void *argument) ...@@ -206,7 +205,7 @@ void *Harmonic(void *argument)
for ( int j = 0; j < nout; j++ ) for ( int j = 0; j < nout; j++ )
{ {
int streamID2 = streamIDs[j]; int streamID2 = streamIDs[j];
streamDefTimestep(streamID2, 0); pstreamDefTimestep(streamID2, 0);
for ( varID = 0; varID < nvars; varID++ ) for ( varID = 0; varID < nvars; varID++ )
{ {
...@@ -215,8 +214,8 @@ void *Harmonic(void *argument) ...@@ -215,8 +214,8 @@ void *Harmonic(void *argument)
for ( levelID = 0; levelID < nlevel; levelID++ ) for ( levelID = 0; levelID < nlevel; levelID++ )
{ {
offset = gridsize*levelID; offset = gridsize*levelID;
streamDefRecord(streamID2, varID, levelID); pstreamDefRecord(streamID2, varID, levelID);
streamWriteRecord(streamID2, out[j][varID]+offset, 0); pstreamWriteRecord(streamID2, out[j][varID]+offset, 0);
} }
} }
} }
...@@ -252,7 +251,7 @@ void *Harmonic(void *argument) ...@@ -252,7 +251,7 @@ void *Harmonic(void *argument)
for ( int j = 0; j < nout; j++ ) for ( int j = 0; j < nout; j++ )
{ {
int streamID2 = streamIDs[j]; int streamID2 = streamIDs[j];
streamDefTimestep(streamID2, 1); pstreamDefTimestep(streamID2, 1);
for ( varID = 0; varID < nvars; varID++ ) for ( varID = 0; varID < nvars; varID++ )
{ {
...@@ -262,11 +261,11 @@ void *Harmonic(void *argument) ...@@ -262,11 +261,11 @@ void *Harmonic(void *argument)
for ( levelID = 0; levelID < nlevel; levelID++ ) for ( levelID = 0; levelID < nlevel; levelID++ )
{ {
offset = gridsize*levelID; offset = gridsize*levelID;
streamDefRecord(streamID2, varID, levelID); pstreamDefRecord(streamID2, varID, levelID);
nmiss = 0; nmiss = 0;
for ( int i = 0; i < gridsize; i++ ) for ( int i = 0; i < gridsize; i++ )
if ( DBL_IS_EQUAL(out[j][varID][i+offset], missval) ) nmiss++; if ( DBL_IS_EQUAL(out[j][varID][i+offset], missval) ) nmiss++;
streamWriteRecord(streamID2, out[j][varID]+offset, nmiss); pstreamWriteRecord(streamID2, out[j][varID]+offset, nmiss);
} }
} }
} }
...@@ -274,7 +273,7 @@ void *Harmonic(void *argument) ...@@ -274,7 +273,7 @@ void *Harmonic(void *argument)
for ( int j = 0; j < n_out; j++ ) for ( int j = 0; j < n_out; j++ )
{ {
int streamID2 = streamIDs[j]; int streamID2 = streamIDs[j];
streamClose(streamID2); pstreamClose(streamID2);
} }
Free(streamIDs); Free(streamIDs);
......
...@@ -96,13 +96,13 @@ void *Hi(void *argument) ...@@ -96,13 +96,13 @@ void *Hi(void *argument)
cdoInitialize(argument); cdoInitialize(argument);
cdoOperatorAdd("hi", 0, 0, NULL); cdoOperatorAdd("hi", 0, 0, NULL);
int streamID1 = streamOpenRead(cdoStreamName(0)); int streamID1 = pstreamOpenRead(cdoStreamName(0));
int streamID2 = streamOpenRead(cdoStreamName(1)); int streamID2 = pstreamOpenRead(cdoStreamName(1));
int streamID3 = streamOpenRead(cdoStreamName(2)); int streamID3 = pstreamOpenRead(cdoStreamName(2));
int vlistID1 = streamInqVlist(streamID1); int vlistID1 = pstreamInqVlist(streamID1);
int vlistID2 = streamInqVlist(streamID2); int vlistID2 = pstreamInqVlist(streamID2);
int vlistID3 = streamInqVlist(streamID3); int vlistID3 = pstreamInqVlist(streamID3);
int taxisID1 = vlistInqTaxis(vlistID1); int taxisID1 = vlistInqTaxis(vlistID1);
//taxisID2 = vlistInqTaxis(vlistID2); //taxisID2 = vlistInqTaxis(vlistID2);
...@@ -141,33 +141,33 @@ void *Hi(void *argument) ...@@ -141,33 +141,33 @@ void *Hi(void *argument)
vlistDefVarLongname(vlistID4, varID4, HI_LONGNAME); vlistDefVarLongname(vlistID4, varID4, HI_LONGNAME);
vlistDefVarUnits(vlistID4, varID4, HI_UNITS); vlistDefVarUnits(vlistID4, varID4, HI_UNITS);
int streamID4 = streamOpenWrite(cdoStreamName(3), cdoFiletype()); int streamID4 = pstreamOpenWrite(cdoStreamName(3), cdoFiletype());
streamDefVlist(streamID4, vlistID4); pstreamDefVlist(streamID4, vlistID4);
int tsID = 0; int tsID = 0;
while ( (nrecs = streamInqTimestep(streamID1, tsID)) ) while ( (nrecs = pstreamInqTimestep(streamID1, tsID)) )
{ {
int nrecs2 = streamInqTimestep(streamID2, tsID); int nrecs2 = pstreamInqTimestep(streamID2, tsID);