Commit 073cc75c authored by Oliver Heidmann's avatar Oliver Heidmann
Browse files

implemented name changes in operator files (pstream* -> cdo*), removed pstream_int.h includes

parent 993976ff
......@@ -27,7 +27,7 @@
#include "cdo_options.h"
#include "cdo_int.h"
#include "param_conversion.h"
#include "pstream_int.h"
#include "util_string.h"
/*
......@@ -288,21 +288,21 @@ Adisit(void *process)
vlistDefTaxis(vlistID2, taxisID2);
const int streamID2 = cdoStreamOpenWrite(cdoStreamName(1));
pstreamDefVlist(streamID2, vlistID2);
cdoDefVlist(streamID2, vlistID2);
int tsID = 0;
while ((nrecs = cdoStreamInqTimestep(streamID1, tsID)))
{
taxisCopyTimestep(taxisID2, taxisID1);
pstreamDefTimestep(streamID2, tsID);
cdoDefTimestep(streamID2, tsID);
for (int recID = 0; recID < nrecs; ++recID)
{
pstreamInqRecord(streamID1, &varID, &levelID);
cdoInqRecord(streamID1, &varID, &levelID);
offset = gridsize * levelID;
if (varID == thoID) pstreamReadRecord(streamID1, tho.ptr + offset, &tho.nmiss);
if (varID == saoID) pstreamReadRecord(streamID1, sao.ptr + offset, &sao.nmiss);
if (varID == thoID) cdoReadRecord(streamID1, tho.ptr + offset, &tho.nmiss);
if (varID == saoID) cdoReadRecord(streamID1, sao.ptr + offset, &sao.nmiss);
}
if (operatorID == ADISIT)
......@@ -316,13 +316,13 @@ Adisit(void *process)
single = tis.ptr + offset;
nmiss = arrayNumMV(gridsize, single, tis.missval);
pstreamDefRecord(streamID2, tisID2, levelID);
pstreamWriteRecord(streamID2, single, nmiss);
cdoDefRecord(streamID2, tisID2, levelID);
cdoWriteRecord(streamID2, single, nmiss);
single = sao.ptr + offset;
nmiss = arrayNumMV(gridsize, single, sao.missval);
pstreamDefRecord(streamID2, saoID2, levelID);
pstreamWriteRecord(streamID2, single, nmiss);
cdoDefRecord(streamID2, saoID2, levelID);
cdoWriteRecord(streamID2, single, nmiss);
}
tsID++;
......
......@@ -34,11 +34,11 @@
#include "cdo_int.h"
#include "cdo_task.h"
#include "pstream_int.h"
#define streamOpenWrite cdoStreamOpenWrite
#define streamDefVlist pstreamDefVlist
#define streamDefTimestep pstreamDefTimestep
#define streamDefVlist cdoDefVlist
#define streamDefTimestep cdoDefTimestep
#include "afterburner.h"
#include "constants.h"
......
......@@ -32,7 +32,6 @@
#include "cdo_int.h"
#include "cdo_options.h"
#include "pstream_int.h"
void *
......@@ -216,7 +215,7 @@ Arith(void *process)
vlistDefTaxis(vlistID3, taxisID3);
const int streamID3 = cdoStreamOpenWrite(2);
pstreamDefVlist(streamID3, vlistID3);
cdoDefVlist(streamID3, vlistID3);
int tsID = 0;
int tsID2 = 0;
......@@ -254,12 +253,12 @@ Arith(void *process)
}
taxisCopyTimestep(taxisID3, taxisIDx1);
pstreamDefTimestep(streamID3, tsID);
cdoDefTimestep(streamID3, tsID);
for (int recID = 0; recID < nrecs; recID++)
{
pstreamInqRecord(streamIDx1, &varID, &levelID);
pstreamReadRecord(streamIDx1, fieldx1->ptr, &nmiss);
cdoInqRecord(streamIDx1, &varID, &levelID);
cdoReadRecord(streamIDx1, fieldx1->ptr, &nmiss);
fieldx1->nmiss = nmiss;
int varID2 = varID;
......@@ -268,8 +267,8 @@ Arith(void *process)
const bool lstatus = nlevels2 > 1 ? varID == 0 : recID == 0;
if (lstatus || (filltype != FILL_VAR && filltype != FILL_VARTS))
{
pstreamInqRecord(streamIDx2, &varID2, &levelID2);
pstreamReadRecord(streamIDx2, fieldx2->ptr, &nmiss);
cdoInqRecord(streamIDx2, &varID2, &levelID2);
cdoReadRecord(streamIDx2, fieldx2->ptr, &nmiss);
fieldx2->nmiss = nmiss;
if (varID != varID2) cdoAbort("Internal error, varIDs of input streams differ!");
if (levelID != levelID2) cdoAbort("Internal error, levelIDs of input streams differ!");
......@@ -322,8 +321,8 @@ Arith(void *process)
else
farfun(field1, field2, operfunc);
pstreamDefRecord(streamID3, varID, levelID);
pstreamWriteRecord(streamID3, field1.ptr, field1.nmiss);
cdoDefRecord(streamID3, varID, levelID);
cdoWriteRecord(streamID3, field1.ptr, field1.nmiss);
}
tsID++;
......
......@@ -29,7 +29,7 @@
#include "cdo_int.h"
#include "param_conversion.h"
#include "pstream_int.h"
static void
fill_vars(int vlistID, std::vector<bool> &vars)
......@@ -110,7 +110,7 @@ Arithc(void *process)
vlistDefTaxis(vlistID2, taxisID2);
const int streamID2 = cdoStreamOpenWrite(cdoStreamName(1));
pstreamDefVlist(streamID2, vlistID2);
cdoDefVlist(streamID2, vlistID2);
const size_t nwpv = (vlistNumber(vlistID1) == CDI_COMP) ? 2 : 1;
if (nwpv == 2 && !opercplx) cdoAbort("Fields with complex numbers are not supported by this operator!");
......@@ -125,12 +125,12 @@ Arithc(void *process)
while ((nrecs = cdoStreamInqTimestep(streamID1, tsID)))
{
taxisCopyTimestep(taxisID2, taxisID1);
pstreamDefTimestep(streamID2, tsID);
cdoDefTimestep(streamID2, tsID);
for (int recID = 0; recID < nrecs; recID++)
{
pstreamInqRecord(streamID1, &varID, &levelID);
pstreamReadRecord(streamID1, field.ptr, &field.nmiss);
cdoInqRecord(streamID1, &varID, &levelID);
cdoReadRecord(streamID1, field.ptr, &field.nmiss);
if (vars[varID])
{
......@@ -148,8 +148,8 @@ Arithc(void *process)
field.nmiss = arrayNumMV(gridsize, field.ptr, field.missval);
}
pstreamDefRecord(streamID2, varID, levelID);
pstreamWriteRecord(streamID2, field.ptr, field.nmiss);
cdoDefRecord(streamID2, varID, levelID);
cdoWriteRecord(streamID2, field.ptr, field.nmiss);
}
tsID++;
......
......@@ -30,7 +30,7 @@
#include "cdo_int.h"
#include "calendar.h"
#include "pstream_int.h"
static double
dayofyear(int calendar, int64_t vdate, int vtime)
......@@ -96,7 +96,7 @@ Arithdays(void *process)
const int calendar = taxisInqCalendar(taxisID1);
const int streamID2 = cdoStreamOpenWrite(cdoStreamName(1));
pstreamDefVlist(streamID2, vlistID2);
cdoDefVlist(streamID2, vlistID2);
const size_t gridsizemax = vlistGridsizeMax(vlistID1);
......@@ -112,7 +112,7 @@ Arithdays(void *process)
const int vtime = taxisInqVtime(taxisID1);
taxisCopyTimestep(taxisID2, taxisID1);
pstreamDefTimestep(streamID2, tsID);
cdoDefTimestep(streamID2, tsID);
cdiDecodeDate(vdate, &year, &month, &day);
......@@ -129,8 +129,8 @@ Arithdays(void *process)
for (int recID = 0; recID < nrecs; recID++)
{
pstreamInqRecord(streamID1, &varID, &levelID);
pstreamReadRecord(streamID1, field.ptr, &nmiss);
cdoInqRecord(streamID1, &varID, &levelID);
cdoReadRecord(streamID1, field.ptr, &nmiss);
field.nmiss = nmiss;
field.grid = vlistInqVarGrid(vlistID1, varID);
......@@ -138,8 +138,8 @@ Arithdays(void *process)
farcfun(field, rconst, operfunc);
pstreamDefRecord(streamID2, varID, levelID);
pstreamWriteRecord(streamID2, field.ptr, field.nmiss);
cdoDefRecord(streamID2, varID, levelID);
cdoWriteRecord(streamID2, field.ptr, field.nmiss);
}
tsID++;
......
......@@ -26,7 +26,7 @@
#include "cdo_options.h"
#include "cdo_int.h"
#include "pstream_int.h"
#include "grid.h"
void *
......@@ -57,7 +57,7 @@ Arithlat(void *process)
vlistDefTaxis(vlistID2, taxisID2);
const int streamID2 = cdoStreamOpenWrite(cdoStreamName(1));
pstreamDefVlist(streamID2, vlistID2);
cdoDefVlist(streamID2, vlistID2);
const size_t gridsizemax = vlistGridsizeMax(vlistID1);
std::vector<double> array(gridsizemax);
......@@ -66,12 +66,12 @@ Arithlat(void *process)
while ((nrecs = cdoStreamInqTimestep(streamID1, tsID)))
{
taxisCopyTimestep(taxisID2, taxisID1);
pstreamDefTimestep(streamID2, tsID);
cdoDefTimestep(streamID2, tsID);
for (int recID = 0; recID < nrecs; recID++)
{
pstreamInqRecord(streamID1, &varID, &levelID);
pstreamReadRecord(streamID1, &array[0], &nmiss);
cdoInqRecord(streamID1, &varID, &levelID);
cdoReadRecord(streamID1, &array[0], &nmiss);
int gridID = vlistInqVarGrid(vlistID1, varID);
size_t gridsize = 0;
......@@ -123,8 +123,8 @@ Arithlat(void *process)
for (size_t i = 0; i < gridsize; ++i) array[i] *= scale[i];
pstreamDefRecord(streamID2, varID, levelID);
pstreamWriteRecord(streamID2, &array[0], nmiss);
cdoDefRecord(streamID2, varID, levelID);
cdoWriteRecord(streamID2, &array[0], nmiss);
}
tsID++;
......
......@@ -19,7 +19,7 @@
#include "cdo_int.h"
#include "param_conversion.h"
#include "pstream_int.h"
#include "process_int.h"
#include "timer.h"
#include "util_files.h"
......@@ -129,7 +129,7 @@ CDIread(void *process)
int vlistID = cdoStreamInqVlist(streamID);
filetype = pstreamInqFiletype(streamID);
filetype = cdoInqFiletype(streamID);
datatype = vlistInqVarDatatype(vlistID, 0);
size_t gridsize = vlistGridsizeMax(vlistID);
......@@ -145,20 +145,20 @@ CDIread(void *process)
for (int recID = 0; recID < nrecs; recID++)
{
pstreamInqRecord(streamID, &varID, &levelID);
cdoInqRecord(streamID, &varID, &levelID);
gridsize = gridInqSize(vlistInqVarGrid(vlistID, varID));
nvalues += gridsize;
if (memtype == MEMTYPE_FLOAT)
{
pstreamReadRecordF(streamID, farray, &nmiss);
cdoReadRecordF(streamID, farray, &nmiss);
// for ( size_t i = 0; i < gridsize; ++i ) darray[i] = farray[i];
data_size += gridsize * 4;
}
else
{
pstreamReadRecord(streamID, darray, &nmiss);
cdoReadRecord(streamID, darray, &nmiss);
data_size += gridsize * 8;
}
}
......
......@@ -24,7 +24,7 @@
#include "cdo_int.h"
#include "param_conversion.h"
#include "cdo_wtime.h"
#include "pstream_int.h"
#include "process_int.h"
void *
......@@ -64,7 +64,7 @@ CDItest(void *process)
vlistDefTaxis(vlistID2, taxisID2);
int streamID2 = cdoStreamOpenWrite(cdoStreamName(1));
pstreamDefVlist(streamID2, vlistID2);
cdoDefVlist(streamID2, vlistID2);
size_t gridsize = vlistGridsizeMax(vlistID1);
double *array = (double *) Malloc(gridsize * sizeof(double));
......@@ -75,21 +75,21 @@ CDItest(void *process)
{
taxisCopyTimestep(taxisID2, taxisID1);
pstreamDefTimestep(streamID2, tsID2);
cdoDefTimestep(streamID2, tsID2);
for (int recID = 0; recID < nrecs; recID++)
{
pstreamInqRecord(streamID1, &varID, &levelID);
pstreamDefRecord(streamID2, varID, levelID);
cdoInqRecord(streamID1, &varID, &levelID);
cdoDefRecord(streamID2, varID, levelID);
if (lcopy)
{
pstreamCopyRecord(streamID2, streamID1);
cdoCopyRecord(streamID2, streamID1);
}
else
{
pstreamReadRecord(streamID1, array, &nmiss);
pstreamWriteRecord(streamID2, array, nmiss);
cdoReadRecord(streamID1, array, &nmiss);
cdoWriteRecord(streamID2, array, nmiss);
}
}
tsID1++;
......
......@@ -19,7 +19,7 @@
#include "cdo_int.h"
#include "param_conversion.h"
#include "pstream_int.h"
#include "grid.h"
#include "griddes.h"
#include "timer.h"
......@@ -173,9 +173,9 @@ CDIwrite(void *process)
int streamID = cdoStreamOpenWrite(cdoStreamName(0));
pstreamDefVlist(streamID, vlistID);
cdoDefVlist(streamID, vlistID);
filetype = pstreamInqFiletype(streamID);
filetype = cdoInqFiletype(streamID);
datatype = vlistInqVarDatatype(vlistID, 0);
if (datatype == CDI_UNDEFID) datatype = CDI_DATATYPE_FLT32;
......@@ -189,23 +189,23 @@ CDIwrite(void *process)
int vtime = 0;
taxisDefVdate(taxisID, vdate);
taxisDefVtime(taxisID, vtime);
pstreamDefTimestep(streamID, tsID);
cdoDefTimestep(streamID, tsID);
for (varID = 0; varID < nvars; varID++)
{
for (levelID = 0; levelID < nlevs; levelID++)
{
nvalues += gridsize;
pstreamDefRecord(streamID, varID, levelID);
cdoDefRecord(streamID, varID, levelID);
if (memtype == MEMTYPE_FLOAT)
{
for (size_t i = 0; i < gridsize; ++i) farray[i] = vars[varID][levelID][i];
pstreamWriteRecordF(streamID, &farray[0], 0);
cdoWriteRecordF(streamID, &farray[0], 0);
data_size += gridsize * 4;
}
else
{
pstreamWriteRecord(streamID, &vars[varID][levelID][0], 0);
cdoWriteRecord(streamID, &vars[varID][levelID][0], 0);
data_size += gridsize * 8;
}
}
......
......@@ -20,7 +20,7 @@
#include "cdo_int.h"
#include "param_conversion.h"
#include "pstream_int.h"
#include "util_files.h"
#ifdef HAVE_LIBCMOR
......@@ -1821,7 +1821,7 @@ static void
dump_special_attributes(list_t *kvl, int streamID)
{
int vlistID = cdoStreamInqVlist(streamID);
int fileID = pstreamFileID(streamID);
int fileID = cdoFileID(streamID);
size_t old_historysize;
char *new_history = kv_get_a_val(kvl, "history", nullptr);
size_t historysize;
......@@ -4708,7 +4708,7 @@ static void
read_record(int streamID, struct mapping vars[], int vlistID)
{
int varID, levelID;
pstreamInqRecord(streamID, &varID, &levelID);
cdoInqRecord(streamID, &varID, &levelID);
int gridID = vlistInqVarGrid(vlistID, varID);
int type = gridInqType(gridID);
......@@ -4722,7 +4722,7 @@ read_record(int streamID, struct mapping vars[], int vlistID)
/* int latdim = gridInqYsize(gridID); */
int levdim = zaxisInqSize(zaxisID);
size_t nmiss;
pstreamReadRecord(streamID, buffer, &nmiss);
cdoReadRecord(streamID, buffer, &nmiss);
for (size_t i = 0; i < gridsize; i++)
{
// Wrong: (lat x basin, lev ) gridsize * levelID + i
......
......@@ -26,7 +26,7 @@
#include "cdo_int.h"
#include "param_conversion.h"
#include "cdo_cmor.h"
#include "pstream_int.h"
#include "pmlist.h"
#include "convert_units.h"
#include "cdo_cdiWrapper.h"
......@@ -427,7 +427,7 @@ CMOR_lite(void *process)
/* vlistPrint(vlistID2);*/
const int streamID2 = cdoStreamOpenWrite(cdoStreamName(1));
pstreamDefVlist(streamID2, vlistID2);
cdoDefVlist(streamID2, vlistID2);
size_t gridsizemax = vlistGridsizeMax(vlistID1);
if (vlistNumber(vlistID1) != CDI_REAL) gridsizemax *= 2;
......@@ -438,13 +438,13 @@ CMOR_lite(void *process)
{
taxisCopyTimestep(taxisID2, taxisID1);
pstreamDefTimestep(streamID2, tsID1);
cdoDefTimestep(streamID2, tsID1);
cmor_check_init(nvars, vars);
for (int recID = 0; recID < nrecs; recID++)
{
pstreamInqRecord(streamID1, &varID, &levelID);
cdoInqRecord(streamID1, &varID, &levelID);
CmorVar &var = vars[varID];
int varID2 = varID;
......@@ -461,9 +461,9 @@ CMOR_lite(void *process)
}
}
pstreamDefRecord(streamID2, varID2, levelID2);
cdoDefRecord(streamID2, varID2, levelID2);
pstreamReadRecord(streamID1, array.data(), &nmiss);
cdoReadRecord(streamID1, array.data(), &nmiss);
const double missval = vlistInqVarMissval(vlistID2, varID2);
size_t gridsize = gridInqSize(vlistInqVarGrid(vlistID2, varID2));
......@@ -506,7 +506,7 @@ CMOR_lite(void *process)
}
#endif
pstreamWriteRecord(streamID2, array.data(), nmiss);
cdoWriteRecord(streamID2, array.data(), nmiss);
cmor_check_prep(var, gridsize, missval, array.data());
}
......
......@@ -24,7 +24,7 @@
#include <cdi.h>
#include "cdo_int.h"
#include "pstream_int.h"
#include "timer.h"
#include "util_files.h"
#include "progress.h"
......@@ -107,7 +107,7 @@ Cat(void *process)
for (varID = 0; varID < nvars; ++varID) vlistDefVarTimetype(vlistID2, varID, TIME_VARYING);
}
pstreamDefVlist(streamID2, vlistID2);
cdoDefVlist(streamID2, vlistID2);
}
if (!lcopy)
......@@ -131,25 +131,25 @@ Cat(void *process)
if (!Options::cdoVerbose) Progress::update(0, 1, fstatus / nfiles);
taxisCopyTimestep(taxisID2, taxisID1);
pstreamDefTimestep(streamID2, tsID2);
cdoDefTimestep(streamID2, tsID2);
for (int recID = 0; recID < nrecs; recID++)
{
pstreamInqRecord(streamID1, &varID, &levelID);
cdoInqRecord(streamID1, &varID, &levelID);
if (lconstvars && tsID2 > 0 && tsID1 == 0)
if (vlistInqVarTimetype(vlistID1, varID) == TIME_CONSTANT) continue;
pstreamDefRecord(streamID2, varID, levelID);
cdoDefRecord(streamID2, varID, levelID);
if (lcopy)
{
pstreamCopyRecord(streamID2, streamID1);
cdoCopyRecord(streamID2, streamID1);
}
else
{
pstreamReadRecord(streamID1, &array[0], &nmiss);
pstreamWriteRecord(streamID2, &array[0], nmiss);
cdoReadRecord(streamID1, &array[0], &nmiss);
cdoWriteRecord(streamID2, &array[0], nmiss);
}
}
......
......@@ -32,7 +32,7 @@
#include "cdo_int.h"
#include "param_conversion.h"
#include "pstream_int.h"
int stringToParam(const char *paramstr);
......@@ -397,17 +397,17 @@ Change(void *process)
if (streamID2 == CDI_UNDEFID)
{
streamID2 = cdoStreamOpenWrite(cdoStreamName(1));
pstreamDefVlist(streamID2, vlistID2);
cdoDefVlist(streamID2, vlistID2);
}
pstreamDefTimestep(streamID2, tsID1);
cdoDefTimestep(streamID2, tsID1);
for (int recID = 0; recID < nrecs; recID++)
{
pstreamInqRecord(streamID1, &varID, &levelID);
pstreamDefRecord(streamID2, varID, levelID);
cdoInqRecord(streamID1, &varID, &levelID);
cdoDefRecord(streamID2, varID, levelID);
pstreamReadRecord(streamID1, &array[0], &nmiss);
pstreamWriteRecord(streamID2, &array[0], nmiss);
cdoReadRecord(streamID1, &array[0], &nmiss);
cdoWriteRecord(streamID2, &array[0], nmiss);
}
tsID1++;
}
......
......@@ -24,7 +24,7 @@
#include <cdi.h>
#include "cdo_int.h"
#include "pstream_int.h"
void *
Change_e5slm(void *process)
......@@ -46,7 +46,7 @@ Change_e5slm(void *process)
vlistDefTaxis(vlistID2, taxisID2);
int streamID2 = cdoStreamOpenWrite(cdoStreamName(1));
pstreamDefVlist(streamID2, vlistID2);
cdoDefVlist(streamID2, vlistID2);
/* get filename of SLM */
operatorInputArg("filename of the sea land mask");
......@@ -113,12 +113,12 @@ Change_e5slm(void *process)
while ((nrecs = cdoStreamInqTimestep(streamID1, tsID)))
{
taxisCopyTimestep(taxisID2, taxisID1);
pstreamDefTimestep(streamID2, tsID);
cdoDefTimestep(streamID2, tsID);
for (int recID = 0; recID < nrecs; recID++)
{
pstreamInqRecord(streamID1, &varID, &levelID);
pstreamReadRecord(streamID1, array.data(), &nmiss);
cdoInqRecord(streamID1, &varID, &levelID);
cdoReadRecord(streamID1, array.data(), &nmiss);
int code = codes[varID];
if (code == 172)
......@@ -145,8 +145,8 @@ Change_e5slm(void *process)
if (lsea[i]) array[i] = array[0];
}
pstreamDefRecord(streamID2, varID, levelID);
pstreamWriteRecord(streamID2, array.data(), nmiss);
cdoDefRecord(streamID2, varID, levelID);
cdoWriteRecord(streamID2, array.data(), nmiss);
}
tsID++;
......
......@@ -20,7 +20,7 @@
#include "cdo_int.h"
#include "param_conversion.h"
#include "cdo_math.h"
#include "pstream_int.h"
#include "util_string.h"
#define SCALESLP (101325.0)
......@@ -290,24 +290,24 @@ Cloudlayer(void *process)
vlistDefTaxis(vlistID2, taxisID2);
int streamID2 = cdoStreamOpenWrite(cdoStreamName(1));
pstreamDefVlist(streamID2, vlistID2);
cdoDefVlist(streamID2, vlistID2);