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

Merge branch 'test' into develop

parents 541a1d7f a9ea605e
......@@ -37,7 +37,8 @@ void *Eofcoeff(void * argument)
field_type in;
field_type out;
int i, varID, levelID;
int nrecs, nmiss;
int nrecs;
size_t nmiss;
cdoInitialize(argument);
......@@ -108,7 +109,7 @@ void *Eofcoeff(void * argument)
cdoAbort("Internal error - too high levelID");
pstreamReadRecord(streamID1, eof[varID][levelID][eofID].ptr, &nmiss);
eof[varID][levelID][eofID].nmiss = (size_t) nmiss;
eof[varID][levelID][eofID].nmiss = nmiss;
}
eofID++;
}
......@@ -181,7 +182,7 @@ void *Eofcoeff(void * argument)
pstreamInqRecord(streamID2, &varID, &levelID);
missval2 = vlistInqVarMissval(vlistID2, varID);
pstreamReadRecord(streamID2, in.ptr, &nmiss);
in.nmiss = (size_t) nmiss;
in.nmiss = nmiss;
for ( eofID = 0; eofID < neof; eofID++ )
{
......
......@@ -36,7 +36,8 @@ void *Eofcoeff3d(void * argument)
double missval1 = -999, missval2 = -999;
field_type in;
int i, varID, levelID;
int nrecs, nmiss;
int nrecs;
size_t nmiss;
cdoInitialize(argument);
......@@ -106,7 +107,7 @@ void *Eofcoeff3d(void * argument)
cdoAbort("Internal error - too high levelID");
pstreamReadRecord(streamID1, eof[varID][levelID][eofID].ptr, &nmiss);
eof[varID][levelID][eofID].nmiss = (size_t) nmiss;
eof[varID][levelID][eofID].nmiss = nmiss;
}
eofID++;
}
......@@ -199,7 +200,7 @@ void *Eofcoeff3d(void * argument)
pstreamInqRecord(streamID2, &varID, &levelID);
pstreamReadRecord(streamID2, in.ptr, &nmiss);
missval2 = vlistInqVarMissval(vlistID2, varID);
in.nmiss = (size_t) nmiss;
in.nmiss = nmiss;
for ( eofID = 0; eofID < neof; eofID++ )
{
......@@ -235,7 +236,7 @@ void *Eofcoeff3d(void * argument)
for ( eofID = 0; eofID < neof; eofID++ ) {
for ( varID = 0; varID < nvars; varID++ ) {
pstreamDefRecord(streamIDs[eofID], varID, 0);
pstreamWriteRecord(streamIDs[eofID], out[varID][eofID].ptr, (int)out[varID][eofID].nmiss);
pstreamWriteRecord(streamIDs[eofID], out[varID][eofID].ptr, out[varID][eofID].nmiss);
}
}
......
......@@ -25,7 +25,8 @@ void *EstFreq(void *argument)
{
int nrecs;
int varID, levelID;
int gridsize, nmiss;
int gridsize;
size_t nmiss;
cdoInitialize(argument);
......
......@@ -516,7 +516,7 @@ void *Expr(void *argument)
{
size_t offset = params[varID].ngp*levelID;
double *vardata = params[varID].data + offset;
int nmiss;
size_t nmiss;
pstreamReadRecord(streamID1, vardata, &nmiss);
params[varID].nmiss += nmiss;
}
......@@ -551,7 +551,7 @@ void *Expr(void *argument)
size_t offset = ngp*levelID;
double *vardata = params[pidx].data + offset;
int nmiss = 0;
size_t nmiss = 0;
for ( size_t i = 0; i < ngp; i++ )
if ( DBL_IS_EQUAL(vardata[i], missval) ) nmiss++;
......
......@@ -41,7 +41,7 @@ void *FC(void *argument)
int gridIDsp = -1, gridIDgp = -1, gridIDfc = -1;
int gridID1 = -1, gridID2 = -1;
int gridID;
int nmiss;
size_t nmiss;
int nlon = 0, nlat = 0, ntr = 0;
int nsp = 0, nfc = 0;
double *array2 = NULL;
......
......@@ -41,7 +41,7 @@ extern "C" {
void fillmiss(field_type *field1, field_type *field2, int nfill)
{
int nx, ny, i, j;
int nmiss2 = 0;
size_t nmiss2 = 0;
int kr, ku, kl, ko;
int ir, iu, il, io;
int kh, kv, k1, k2, kk;
......@@ -51,7 +51,7 @@ void fillmiss(field_type *field1, field_type *field2, int nfill)
double **matrix1, **matrix2;
int gridID = field1->grid;
int nmiss1 = field1->nmiss;
size_t nmiss1 = field1->nmiss;
double missval = field1->missval;
double *array1 = field1->ptr;
double *array2 = field2->ptr;
......@@ -156,7 +156,7 @@ void fillmiss(field_type *field1, field_type *field2, int nfill)
void fillmiss_one_step(field_type *field1, field_type *field2, int maxfill)
{
int gridID, nx, ny, i, j;
int nmiss2 = 0;
size_t nmiss2 = 0;
int kr, ku, kl, ko;
int ir, iu, il, io;
int kh, kv, k1, k2, kk;
......@@ -419,7 +419,7 @@ void setmisstodis(field_type *field1, field_type *field2, int num_neighbors)
void *Fillmiss(void *argument)
{
int nmiss;
size_t nmiss;
int nrecs, varID, levelID;
void (*fill_method) (field_type *fin , field_type *fout , int) = NULL;
......@@ -528,7 +528,7 @@ void *Fillmiss(void *argument)
fill_method(&field1, &field2, nfill);
int gridsize = gridInqSize(field2.grid);
int nmiss = 0;
size_t nmiss = 0;
for ( int i = 0; i < gridsize; ++i )
if ( DBL_IS_EQUAL(field2.ptr[i], field2.missval) ) nmiss++;
......
......@@ -124,7 +124,7 @@ void *Filter(void *argument)
int nrecs;
int varID, levelID;
int nalloc = 0;
int nmiss;
size_t nmiss;
int incperiod0, incunit0, incunit;
int year0, month0, day0;
bool use_fftw = false;
......@@ -396,7 +396,7 @@ void *Filter(void *argument)
{
if ( vars[tsID][varID][levelID].ptr )
{
int nmiss = vars[tsID][varID][levelID].nmiss;
size_t nmiss = vars[tsID][varID][levelID].nmiss;
pstreamDefRecord(streamID2, varID, levelID);
pstreamWriteRecord(streamID2, vars[tsID][varID][levelID].ptr, nmiss);
......
......@@ -34,7 +34,7 @@ void *Fldrms(void *argument)
int index;
int nrecs;
int varID, levelID;
int nmiss;
size_t nmiss;
double sglval;
cdoInitialize(argument);
......@@ -116,10 +116,10 @@ void *Fldrms(void *argument)
{
pstreamInqRecord(streamID1, &varID, &levelID);
pstreamReadRecord(streamID1, field1.ptr, &nmiss);
field1.nmiss = (size_t) nmiss;
field1.nmiss = nmiss;
pstreamInqRecord(streamID2, &varID, &levelID);
pstreamReadRecord(streamID2, field2.ptr, &nmiss);
field2.nmiss = (size_t) nmiss;
field2.nmiss = nmiss;
field1.grid = vlistInqVarGrid(vlistID1, varID);
field2.grid = vlistInqVarGrid(vlistID2, varID);
......@@ -147,7 +147,7 @@ void *Fldrms(void *argument)
fldrms(field1, field2, &field3);
pstreamDefRecord(streamID3, varID, levelID);
pstreamWriteRecord(streamID3, &sglval, (int)field3.nmiss);
pstreamWriteRecord(streamID3, &sglval, field3.nmiss);
}
tsID++;
}
......
......@@ -87,7 +87,7 @@ void *Fldstat(void *argument)
int index;
int nrecs;
int varID, levelID;
int nmiss;
size_t nmiss;
double sglval;
cdoInitialize(argument);
......
......@@ -94,7 +94,7 @@ void *Fldstat2(void *argument)
int gridID3;
int nrecs, nrecs2;
int varID, levelID;
int nmiss1, nmiss2;
size_t nmiss1, nmiss2;
bool wstatus = false;
bool needWeights = true;
double sglval = 0;
......@@ -193,7 +193,7 @@ void *Fldstat2(void *argument)
sglval = covariance_s(array1, array2, weight, missval1, missval2, gridsize);
}
int nmiss3 = DBL_IS_EQUAL(sglval, missval1) ? 1 : 0;
size_t nmiss3 = DBL_IS_EQUAL(sglval, missval1) ? 1 : 0;
pstreamDefRecord(streamID3, varID, levelID);
pstreamWriteRecord(streamID3, &sglval, nmiss3);
......
......@@ -33,7 +33,7 @@ void *Fourier(void *argument)
int nrecs;
int gridID, varID, levelID;
int nalloc = 0;
int nmiss;
size_t nmiss;
int nlevel;
int *vdate = NULL, *vtime = NULL;
double missval;
......
......@@ -30,7 +30,7 @@
void *Gengrid(void *argument)
{
int varID, levelID;
int nmiss1, nmiss2;
size_t nmiss1, nmiss2;
double missval = 0;
cdoInitialize(argument);
......
......@@ -963,7 +963,7 @@ void *Gradsdes(void *argument)
int idmn, idhh, idmm, idyy, iddd;
int dt=1, iik=0, mdt = 0;
int gridsize = 0;
int nmiss;
size_t nmiss;
int prec;
int map_version = 2;
int maxrecs = 0;
......
......@@ -521,7 +521,7 @@ void gridboxstat(field_type *field1, field_type *field2, int xinc, int yinc, int
field2->ptr[ig] = fldfun(field[ompthID], statfunc);
}
int nmiss = 0;
size_t nmiss = 0;
for ( int i = 0; i < nlat2*nlon2; i++ )
if ( DBL_IS_EQUAL(array2[i], missval) ) nmiss++;
......@@ -613,10 +613,10 @@ void *Gridboxstat(void *argument)
for ( int recID = 0; recID < nrecs; recID++ )
{
int nmiss;
size_t nmiss;
pstreamInqRecord(streamID1, &varID, &levelID);
pstreamReadRecord(streamID1, field1.ptr, &nmiss);
field1.nmiss = (size_t) nmiss;
field1.nmiss = nmiss;
field1.grid = vlistInqVarGrid(vlistID1, varID);
field1.size = gridInqSize(field1.grid);
......@@ -640,7 +640,7 @@ void *Gridboxstat(void *argument)
gridboxstat(&field1, &field2, xinc, yinc, operfunc);
pstreamDefRecord(streamID2, varID, levelID);
pstreamWriteRecord(streamID2, field2.ptr, (int)field2.nmiss);
pstreamWriteRecord(streamID2, field2.ptr, field2.nmiss);
}
tsID++;
}
......
......@@ -32,7 +32,7 @@ void *Harmonic(void *argument)
int gridsize;
int nrecs;
int varID, levelID;
int nmiss;
size_t nmiss;
int offset;
int nlevel;
int vdate = 0, vtime = 0;
......
......@@ -49,15 +49,15 @@ static double humidityIndex(double t, double e, double r, double missval)
static void farexpr(field_type *field1, field_type field2, field_type field3, double (*expression)(double, double, double, double))
{
const int grid1 = field1->grid;
const int nmiss1 = field1->nmiss;
const size_t nmiss1 = field1->nmiss;
const double missval1 = field1->missval;
double *array1 = field1->ptr;
const int grid2 = field2.grid;
const int nmiss2 = field2.nmiss;
const size_t nmiss2 = field2.nmiss;
const double missval2 = field2.missval;
const double *array2 = field2.ptr;
const int grid3 = field3.grid;
const int nmiss3 = field3.nmiss;
const size_t nmiss3 = field3.nmiss;
const double missval3 = field3.missval;
const double *array3 = field3.ptr;
......@@ -88,7 +88,7 @@ static void farexpr(field_type *field1, field_type field2, field_type field3, do
void *Hi(void *argument)
{
int nmiss;
size_t nmiss;
int nrecs;
int varID1, varID2, varID3;
int levelID1, levelID2, levelID3;
......@@ -160,15 +160,15 @@ void *Hi(void *argument)
{
pstreamInqRecord(streamID1, &varID1, &levelID1);
pstreamReadRecord(streamID1, field1.ptr, &nmiss);
field1.nmiss = (size_t) nmiss;
field1.nmiss = nmiss;
pstreamInqRecord(streamID2, &varID2, &levelID2);
pstreamReadRecord(streamID2, field2.ptr, &nmiss);
field2.nmiss = (size_t) nmiss;
field2.nmiss = nmiss;
pstreamInqRecord(streamID3, &varID3, &levelID3);
pstreamReadRecord(streamID3, field3.ptr, &nmiss);
field3.nmiss = (size_t) nmiss;
field3.nmiss = nmiss;
if ( varID1 != varID2 || varID1 != varID3 || levelID1 != levelID2 || levelID1 != levelID3 )
cdoAbort("Input streams have different structure!");
......@@ -187,7 +187,7 @@ void *Hi(void *argument)
farexpr(&field1, field2, field3, humidityIndex);
pstreamDefRecord(streamID4, varID4, levelID1);
pstreamWriteRecord(streamID4, field1.ptr, (int)field1.nmiss);
pstreamWriteRecord(streamID4, field1.ptr, field1.nmiss);
}
tsID++;
......
......@@ -30,7 +30,7 @@
void *Histogram(void *argument)
{
int nrecs, varID, levelID;
int nmiss;
size_t nmiss;
int offset;
int nlevel, zaxisID;
double missval;
......
......@@ -111,7 +111,7 @@ void init_amsr_averaged(int vlistID, int gridID, int zaxisID, int nvars)
}
static
void read_amsr(FILE *fp, int vlistID, int nvars, double *data[], int *nmiss)
void read_amsr(FILE *fp, int vlistID, int nvars, double *data[], size_t *nmiss)
{
int varID, i, gridsize;
unsigned char *amsr_data = NULL;
......@@ -148,7 +148,7 @@ void read_amsr(FILE *fp, int vlistID, int nvars, double *data[], int *nmiss)
}
static
void write_data(int streamID, int nvars, double *data[], int *nmiss)
void write_data(int streamID, int nvars, double *data[], size_t *nmiss)
{
for ( int varID = 0; varID < nvars; ++varID )
{
......@@ -176,7 +176,7 @@ void *Importamsr(void *argument)
int vtime = 0;
double xvals[NLON], yvals[NLAT];
double *data[MAX_VARS];
int nmiss[MAX_VARS];
size_t nmiss[MAX_VARS];
cdoInitialize(argument);
......
......@@ -188,7 +188,7 @@ int define_level(dsets_t *pfi, int nlev)
void *Importbinary(void *argument)
{
int i;
int nmiss = 0, n_nan;
size_t nmiss = 0, n_nan;
int ivar;
int varID = -1, levelID, tsID;
int gridsize;
......@@ -536,7 +536,7 @@ void *Importbinary(void *argument)
}
/*
if ( cdoVerbose )
printf("%3d %4d %3d %6d %6d %12.5g %12.5g\n", tsID, recID, recoffset, nmiss, n_nan, fmin, fmax);
printf("%3d %4d %3d %6zu %6zu %12.5g %12.5g\n", tsID, recID, recoffset, nmiss, n_nan, fmin, fmax);
*/
varID = recVarID[recID];
levelID = recLevelID[recID];
......
......@@ -769,7 +769,7 @@ void read_dataset(hid_t loc_id, const char *name, void *opdata)
char varname[CDI_MAX_NAME];
short *mask = NULL;
double minval, maxval;
int nmiss;
size_t nmiss;
int num_attrs;
attstring[0] = 0;
......@@ -1395,7 +1395,7 @@ void *Importcmsaf(void *argument)
int streamID;
int gridID = -1, zaxisID, taxisID, vlistID;
int i, offset;
int nmiss;
size_t nmiss;
int ivar;
int varID, levelID, tsID;
int nx, ny, nz, nt, gridsize;
......@@ -1593,7 +1593,7 @@ void *Importcmsaf(void *argument)
if ( DBL_IS_EQUAL(array[i], missval) ) nmiss++;
if ( cdoVerbose )
cdoPrint(" Write var %d, level %d, nmiss %d, missval %g, minval %g, maxval %g",
cdoPrint(" Write var %d, level %d, nmiss %zu, missval %g, minval %g, maxval %g",
varID, levelID, nmiss, missval, minval, maxval);
/*
if ( ! (missval < minval || missval > maxval) )
......
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