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

Merge branch 'test' into develop

parents 541a1d7f a9ea605e
......@@ -66,7 +66,7 @@ void write_data(int streamID, int vlistID, int nvars, double *data[])
pstreamDefRecord(streamID, varID, 0);
int nmiss = 0;
size_t nmiss = 0;
for ( int i = 0; i < gridsize; ++i )
if ( DBL_IS_EQUAL(data[varID][i], missval) ) nmiss++;
......
......@@ -241,7 +241,7 @@ void printMap(int nlon, int nlat, double *array, double missval, double min, dou
typedef struct {
double min, max, sum, sumi;
long nvals, nmiss, nlevs;
size_t nvals, nmiss, nlevs;
} infostat_type;
static
......@@ -263,8 +263,8 @@ void *Info(void *argument)
int fpeRaised = 0;
int varID, levelID;
int nrecs;
int nmiss;
long imiss = 0;
size_t nmiss;
size_t imiss = 0;
char varname[CDI_MAX_NAME];
char paramstr[32];
char vdatestr[32], vtimestr[32];
......@@ -351,7 +351,7 @@ void *Info(void *argument)
int zaxisID = vlistInqVarZaxis(vlistID, varID);
int number = vlistInqVarNumber(vlistID, varID);
long gridsize = gridInqSize(gridID);
long nlevs = zaxisInqSize(zaxisID);
size_t nlevs = zaxisInqSize(zaxisID);
double level = cdoZaxisInqLevel(zaxisID, levelID);
double missval = vlistInqVarMissval(vlistID, varID);
......@@ -383,11 +383,11 @@ void *Info(void *argument)
set_text_color(stdout, RESET, GREEN);
if ( operatorID == XINFON )
fprintf(stdout, "%7ld ", nlevs);
fprintf(stdout, "%7zu ", nlevs);
else
fprintf(stdout, "%7g ", level);
fprintf(stdout, "%8ld %7ld ", gridsize, infostatp->nmiss);
fprintf(stdout, "%8ld %7zu ", gridsize, infostatp->nmiss);
set_text_color(stdout, RESET, BLACK);
fprintf(stdout, ":");
......@@ -402,7 +402,7 @@ void *Info(void *argument)
if ( infostatp->nmiss > 0 )
{
long nvals = 0;
size_t nvals = 0;
for ( long i = 0; i < gridsize; ++i )
{
if ( !DBL_IS_EQUAL(array[i], missval) )
......@@ -452,7 +452,7 @@ void *Info(void *argument)
}
else
{
long nvals = 0;
size_t nvals = 0;
for ( long i = 0; i < gridsize; i++ )
{
if ( !DBL_IS_EQUAL(array[i*2], missval) &&
......@@ -505,7 +505,7 @@ void *Info(void *argument)
}
if ( imiss != nmiss && nmiss > 0 )
cdoPrint("Found %d of %d missing values!", imiss, nmiss);
cdoPrint("Found %zu of %zu missing values!", imiss, nmiss);
if ( fpeRaised > 0 ) cdoWarning("floating-point exception reported: %s!", fpe_errstr(fpeRaised));
......
......@@ -245,7 +245,7 @@ void *Input(void *argument)
pstreamDefRecord(streamID, varID, levelID);
int offset = gridsize*levelID;
int nmiss = 0;
size_t nmiss = 0;
for ( i = 0; i < gridsize; ++i )
if ( DBL_IS_EQUAL(array[offset+i], missval) ) nmiss++;
......
......@@ -224,7 +224,7 @@ void boxavg(field_type *field1, field_type *field2, int xinc, int yinc)
xfield2[ilat][ilon] /= in;
}
int nmiss = 0;
size_t nmiss = 0;
for ( int i = 0; i < nlat2*nlon2; i++ )
if ( DBL_IS_EQUAL(array2[i], missval) ) nmiss++;
......@@ -271,7 +271,7 @@ void thinout(field_type *field1, field_type *field2, int xinc, int yinc)
olat++;
}
int nmiss = 0;
size_t nmiss = 0;
for ( int i = 0; i < nlat2*nlon2; i++ )
if ( DBL_IS_EQUAL(array2[i], missval) ) nmiss++;
......@@ -288,7 +288,7 @@ void *Intgrid(void *argument)
int nrecs;
int varID, levelID;
int gridID1 = -1, gridID2 = -1;
int nmiss;
size_t nmiss;
int xinc = 0, yinc = 0;
double missval;
......
......@@ -55,7 +55,7 @@ void *Intgridtraj(void *argument)
int gridID1;
int varID, levelID;
int vdate, vtime;
int nmiss;
size_t nmiss;
double point;
double xpos, ypos;
int calendar = CALENDAR_STANDARD;
......
......@@ -159,7 +159,7 @@ void *Intlevel(void *argument)
int nrecs;
int i, offset;
int varID, levelID;
int nmiss;
size_t nmiss;
int zaxisID1 = -1;
int gridID, zaxisID;
int nlevel = 0;
......@@ -290,7 +290,7 @@ void *Intlevel(void *argument)
bool *vars = (bool*) Malloc(nvars*sizeof(bool));
bool *varinterp = (bool*) Malloc(nvars*sizeof(bool));
int **varnmiss = (int**) Malloc(nvars*sizeof(int*));
size_t **varnmiss = (size_t**) Malloc(nvars*sizeof(size_t*));
double **vardata1 = (double**) Malloc(nvars*sizeof(double*));
double **vardata2 = (double**) Malloc(nvars*sizeof(double*));
......@@ -309,14 +309,14 @@ void *Intlevel(void *argument)
{
varinterp[varID] = true;
vardata2[varID] = (double*) Malloc(gridsize*nlev2*sizeof(double));
varnmiss[varID] = (int*) Malloc(maxlev*sizeof(int));
memset(varnmiss[varID], 0, maxlev*sizeof(int));
varnmiss[varID] = (size_t*) Malloc(maxlev*sizeof(size_t));
memset(varnmiss[varID], 0, maxlev*sizeof(size_t));
}
else
{
varinterp[varID] = false;
vardata2[varID] = vardata1[varID];
varnmiss[varID] = (int*) Malloc(nlevel*sizeof(int));
varnmiss[varID] = (size_t*) Malloc(nlevel*sizeof(size_t));
}
}
......
......@@ -40,7 +40,7 @@ void *Intlevel3d(void *argument)
int tsID, varID, levelID;
int nvars,nvct;
int nzaxis;
int nmiss;
size_t nmiss;
int nlonIn, nlatIn, nlonOut, nlatOut;
//double *lonIn, *latIn, *lonOut, *latOut;
......@@ -53,7 +53,7 @@ void *Intlevel3d(void *argument)
double *single1, *single2;
int taxisID1, taxisID3;
double *zlevels_in, *zlevels_out;
int zlevels_in_miss, zlevels_out_miss;
size_t zlevels_in_miss, zlevels_out_miss;
char varname[10];
cdoInitialize(argument);
......@@ -319,7 +319,7 @@ void *Intlevel3d(void *argument)
nvars = vlistNvars(vlistID1);
bool *vars = (bool*) Malloc(nvars*sizeof(bool));
bool *varinterp = (bool*) Malloc(nvars*sizeof(bool)); /* marker for variables to be interpolated */
int **varnmiss = (int**) Malloc(nvars*sizeof(int*)); /* can for missing values of arbitrary variables */
size_t **varnmiss = (size_t**) Malloc(nvars*sizeof(size_t*)); /* can for missing values of arbitrary variables */
double **vardata1 = (double**) Malloc(nvars*sizeof(double*)); /* input */
double **vardata2 = (double**) Malloc(nvars*sizeof(double*)); /* output */
......@@ -359,22 +359,22 @@ void *Intlevel3d(void *argument)
{
varinterp[varID] = false;
vardata2[varID] = vardata1[varID];
varnmiss[varID] = (int*) Malloc(nlevel*sizeof(int));
varnmiss[varID] = (size_t*) Malloc(nlevel*sizeof(size_t));
if ( cdoVerbose ) cdoPrint("Ignore variable %s with %d levels",varname,nlevel);
}
else
{
varinterp[varID] = true;
vardata2[varID] = (double*) Malloc(gridsize*nlevo*sizeof(double));
varnmiss[varID] = (int*) Malloc(maxlev*sizeof(int));
memset(varnmiss[varID], 0, maxlev*sizeof(int));
varnmiss[varID] = (size_t*) Malloc(maxlev*sizeof(size_t));
memset(varnmiss[varID], 0, maxlev*sizeof(size_t));
}
}
else
{
varinterp[varID] = false;
vardata2[varID] = vardata1[varID];
varnmiss[varID] = (int*) Malloc(nlevel*sizeof(int));
varnmiss[varID] = (size_t*) Malloc(nlevel*sizeof(size_t));
if ( cdoVerbose ) cdoPrint("Ignore variable %s with %d levels",varname,nlevel);
}
}
......
......@@ -60,8 +60,8 @@ void *Intntime(void *argument)
int gridsize = vlistGridsizeMax(vlistID1);
double *array = (double*) Malloc(gridsize*sizeof(double));
int **nmiss1 = (int **) Malloc(nvars*sizeof(int *));
int **nmiss2 = (int **) Malloc(nvars*sizeof(int *));
size_t **nmiss1 = (size_t **) Malloc(nvars*sizeof(size_t *));
size_t **nmiss2 = (size_t **) Malloc(nvars*sizeof(size_t *));
double **vardata1 = (double **) Malloc(nvars*sizeof(double *));
double **vardata2 = (double **) Malloc(nvars*sizeof(double *));
......@@ -69,8 +69,8 @@ void *Intntime(void *argument)
{
gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
nmiss1[varID] = (int*) Malloc(nlevel*sizeof(int));
nmiss2[varID] = (int*) Malloc(nlevel*sizeof(int));
nmiss1[varID] = (size_t*) Malloc(nlevel*sizeof(size_t));
nmiss2[varID] = (size_t*) Malloc(nlevel*sizeof(size_t));
vardata1[varID] = (double*) Malloc(gridsize*nlevel*sizeof(double));
vardata2[varID] = (double*) Malloc(gridsize*nlevel*sizeof(double));
}
......@@ -164,7 +164,7 @@ void *Intntime(void *argument)
single1 = vardata1[varID] + offset;
single2 = vardata2[varID] + offset;
int nmiss3 = 0;
size_t nmiss3 = 0;
if ( nmiss1[varID][levelID] > 0 || nmiss2[varID][levelID] > 0 )
{
......
......@@ -105,8 +105,8 @@ void *Inttime(void *argument)
int gridsize = vlistGridsizeMax(vlistID1);
double *array = (double*) Malloc(gridsize*sizeof(double));
int **nmiss1 = (int **) Malloc(nvars*sizeof(int *));
int **nmiss2 = (int **) Malloc(nvars*sizeof(int *));
size_t **nmiss1 = (size_t **) Malloc(nvars*sizeof(size_t *));
size_t **nmiss2 = (size_t **) Malloc(nvars*sizeof(size_t *));
double **vardata1 = (double **) Malloc(nvars*sizeof(double *));
double **vardata2 = (double **) Malloc(nvars*sizeof(double *));
......@@ -114,8 +114,8 @@ void *Inttime(void *argument)
{
gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
nmiss1[varID] = (int*) Malloc(nlevel*sizeof(int));
nmiss2[varID] = (int*) Malloc(nlevel*sizeof(int));
nmiss1[varID] = (size_t*) Malloc(nlevel*sizeof(size_t));
nmiss2[varID] = (size_t*) Malloc(nlevel*sizeof(size_t));
vardata1[varID] = (double*) Malloc(gridsize*nlevel*sizeof(double));
vardata2[varID] = (double*) Malloc(gridsize*nlevel*sizeof(double));
}
......@@ -227,7 +227,7 @@ void *Inttime(void *argument)
single1 = vardata1[varID] + offset;
single2 = vardata2[varID] + offset;
int nmiss3 = 0;
size_t nmiss3 = 0;
if ( nmiss1[varID][levelID] > 0 || nmiss2[varID][levelID] > 0 )
{
......
......@@ -34,7 +34,7 @@ void *Intyear(void *argument)
{
int nrecs;
int varID, levelID;
int nmiss1, nmiss2, nmiss3;
size_t nmiss1, nmiss2, nmiss3;
char filesuffix[32];
char filename[8192];
......
......@@ -283,7 +283,7 @@ void *Invert(void *argument)
int nrecs;
int varID, levelID;
int gridID1;
int nmiss;
size_t nmiss;
cdoInitialize(argument);
......
......@@ -93,7 +93,7 @@ void *Invertlev(void *argument)
{
int nrecs;
int varID, levelID;
int nmiss;
size_t nmiss;
int nlev, nlevel;
int gridID, zaxisID, offset;
bool linvert = false;
......@@ -129,7 +129,7 @@ void *Invertlev(void *argument)
int nvars = vlistNvars(vlistID1);
double **vardata = (double**) Malloc(nvars*sizeof(double*));
int **varnmiss = (int**) Malloc(nvars*sizeof(int*));
size_t **varnmiss = (size_t**) Malloc(nvars*sizeof(size_t*));
for ( varID = 0; varID < nvars; varID++ )
{
......@@ -147,7 +147,7 @@ void *Invertlev(void *argument)
{
linvert = true;
vardata[varID] = (double*) Malloc(gridsize*nlev*sizeof(double));
varnmiss[varID] = (int*) Malloc(nlev*sizeof(int));
varnmiss[varID] = (size_t*) Malloc(nlev*sizeof(size_t));
}
}
......
......@@ -81,7 +81,7 @@ void *Isosurface(void *argument)
int gridID;
int i, offset;
int varID, levelID;
int nmiss;
size_t nmiss;
int zaxisID, zaxisID1 = -1;
double missval;
double *single;
......
......@@ -882,7 +882,7 @@ void *Maggraph(void *argument)
int gridID;
int nrecs;
int vlistID0 = -1;
int nmiss;
size_t nmiss;
long nts_alloc;
int nparam = operatorArgc();
......
......@@ -1102,7 +1102,7 @@ void *Magplot(void *argument)
#if defined(HAVE_LIBMAGICS)
int nrecs;
int levelID;
int nmiss;
size_t nmiss;
char varname[CDI_MAX_NAME];
char units[CDI_MAX_NAME];
char vdatestr[32], vtimestr[32], datetimestr[64];
......
......@@ -316,7 +316,7 @@ void *Magvector(void *argument)
#if defined(HAVE_LIBMAGICS)
int nrecs;
int levelID;
int nmiss;
size_t nmiss;
char varname[CDI_MAX_NAME];
char units[CDI_MAX_NAME];
char vdatestr[32],vtimestr[32],datetimestr[64];
......
......@@ -38,7 +38,8 @@
* function definition */
void read_first_record(char *filename, double *field)
{
int nmiss,varID,levelID;
size_t nmiss;
int varID,levelID;
int streamID = streamOpenRead(filename);
streamInqTimestep(streamID,0);
streamInqRecord(streamID,&varID,&levelID);
......@@ -72,7 +73,7 @@ void *MapReduce(void *argument)
{
int nrecs;
int varID, levelID;
int nmiss;
size_t nmiss;
int nobounds = FALSE;
int nocoords = FALSE;
/*double missval1, missval2; */
......
......@@ -399,7 +399,7 @@ void *Maskbox(void *argument)
if ( vars[varID] )
{
int nmiss;
size_t nmiss;
pstreamReadRecord(streamID1, array, &nmiss);
double missval = vlistInqVarMissval(vlistID1, varID);
......
......@@ -30,7 +30,7 @@
static
void mastrfu(int gridID, int zaxisID, double *array1, double *array2, int nmiss, double missval)
void mastrfu(int gridID, int zaxisID, double *array1, double *array2, size_t nmiss, double missval)
{
int ilev, ilat, n;
double fact = 4*atan(1.0) * 6371000 / 9.81;
......@@ -109,7 +109,7 @@ void *Mastrfu(void *argument)
int nrecs;
int varID, levelID;
int offset;
int nmiss, nmiss1;
size_t nmiss, nmiss1;
cdoInitialize(argument);
......
......@@ -46,7 +46,7 @@ void *Math(void *argument)
enum {ABS, FINT, FNINT, SQR, SQRT, EXP, LN, LOG10, SIN, COS, TAN, ASIN, ACOS, ATAN, POW, RECI};
int nrecs;
int varID, levelID;
int nmiss, nmiss2;
size_t nmiss, nmiss2;
int i;
cdoInitialize(argument);
......
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